#include<stdio.h>
int main()
{
int a;
float C, F;
printf("Want C to F, please input 1!\n");
printf("Want F to C, please input 2! \n");
scanf("%d",&a);
switch(a)
{
case 1:
{printf("Plesse input C:\n");
scanf("%f",&C);
F=(9.0/5.0)*C+32.0;
printf("The F is:%g\n",F);}
break;
case 2:
{
printf("Please input F:");
scanf("%f",&F);
C=(5.0/9.0)*(F-32.0);
printf("The C is:%g\n",C);}
break;
default:
printf("Input error!\n");
}
return 0;
}
什么这个程序,如果要在输入非1和2的时候重新回到
printf("Want C to F,please input 1!");这里,不用goto,应该怎样改啊?