int temp; if (a > b && a > c) temp = a; if (b > a && b > c) temp = b; if (c > a && c > b) temp = c; } int main() { int a, b, c; printf("请输入三个数字:"); scanf("%d%d%d",&a,&b,&c); printf("三个数字的最大值为: %d ", max(a, b, c)); r...
void main(){int a,b,c,d;scanf("%d,%d,%d",&a,&b,&c);d=max(a,b,c);printf("max=%d",d);getch();/*暂停看运行结果*/ } int max(int x,int y,int z){int u;if(x>=y&&x>=z)u=x;else if(y>=x&&y>=z)u=y;else u=z;return(u);绝对正确!
include<stdio.h>int main(){ int a, b, c; while(1) { puts("pleas enter three numbers"); if(scanf("%d%d%d", &a, &b, &c)==3) break; printf("input error\n"); while(getchar()!='\n'); } if (a > b) { if (a > c) pr...
这不太对吧,你运行的程序不是你当前代码的编译产物。按照代码,直接按照a,b,c输入就行,例如:2,4...
include<stdio.h>int main(){int a, b, c;int max = 0; //这地有没有=0都一样 scanf("%d%d%d", &a,&b,&c);if (a>b){if (a>c){max = a;}else{max = c;}}else{if (b>c){max = b;}else{max = c;}}printf("%d", max); //这个地方不用加& return 0;} ...
这不太对吧,你运行的程序不是你当前代码的编译产物。按照代码,直接按照a,b,c输入就行,例如:2,4...
if (b > a && b > c) temp = b; if (c > a && c > b) temp = c; } int main() { int a, b, c; printf("请输入三个数字:"); scanf("%d%d%d",&a,&b,&c); printf("三个数字的最大值为: %d ", max(a, b, c)); ...