#include <stdio.h>
void main(){
int a, b, c, max, flag = 1;
char sr[] = "";
printf("请输入三个数:\n");
scanf("%d%d%d",&a, &b, &c);
while(flag){
if(a>b){
max = a;
if(a>c){
max=a;
}else{
max=c;
}
}else{
max = b;
if(b>c){
max = b;
}else{
max = c;
}
}
printf("最大数为%d:\n", max);
printf("是否继续输入三位数进行对比?是的话输入yes,否的话输入no.\n");
scanf("%s", &sr);
if(strcmp(sr,"yes")!=0){
break;
}else{
scanf("%d%d%d",&a, &b, &c);
}
// printf("请输入1或0,输入1继续,输入0停止程序。");
// scanf("%d", &flag);
// if(flag==0){
// break;
// }else{
// scanf("%d%d%d",&a, &b, &c);
// }
}
}
10-30
4931
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-13
3724
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-22
1196
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)