解题思路:
注意事项:
参考代码:
#include<stdio.h> #define MAX(a,b,c) (a>b?(a>c?a:c):(b>c?b:c)) float pmax(float a,float b,float c); int main() { float a,b,c; int gmax; scanf("%f%f%f",&a,&b,&c); printf("%.3f\n",MAX(a,b,c)); printf("%.3f\n",pmax(a,b,c)); return 0; } float pmax(float a,float b,float c) { int pmax = 0; if(a>b) pmax = a; else pmax = b; if(c>pmax) return c; else return pmax; }
0.0分
0 人评分