#include<stdio.h> int main() { int a = 0 ,b = 0 ,c = 0,max = 0; puts("Input 3 integers:"); scanf("%d%d%d",&a,&b,&c); max = a; if(max < b) max = b; if(max < c) max = c; printf("%d %d %d中最大的是%d\n",a,b,c,max); return 0; }
#include <stdio.h> void main() { int max(int x,int y); int a,b,c,_max; printf("enter data:\n"); scanf("%d,%d,%d",&a,&b,&c); _max=max(a,max(b,c)); printf("max=%d\n",_max); } int max(int x,int y) { int z; if(x>y) z=x; else z=y; return z; }