do-while问题求解
#include<stdio.h> #include<stdlib.h>
int main(){
int c;
do{
scanf("%d",&c);
switch(c)
{
搜索
case 0:
printf("thank you\n");
break;
case 1:
printf("please input\n");
break;
case 2:
printf("please input number\n");
break;
default:
printf("error\n");
break;
}
}while(c);
return 0;
}
为啥输入0时结束,而不是别的?哪里决定的?