#include <stdio.h>
int main(int argc, const char * argv[]) {
int num1, i = 0,max = 0;
while (i < 3)
{
printf("请输入第%d个数:\n",i+1);
scanf("%d",&num1);
if (i == 0) {
max = num1;
} else if (num1 > max){
max = num1;
}
i++;
}
printf("这个数的最大值是:%d\n",max);
return 0;
}
|
|