为毛run了之后永远都是在执行IF里的语句啊
/*...*/
#include<stdio.h> int main(void)
{
float c,f;
int choice; printf("1 for centigrade to fahrenheit"
"\n2 for fahrenheir to centigrade");
scanf("%d",&choice); if (choice=1)
{
printf("please input the temperature");
scanf("%f",&c);
f=c*1.8+32L;
printf("%.2f",f);
}
else
{
printf("please input the temperature");
scanf("%f",&f);
c=(f-32)*5/9l;
printf("%.2f",c);
}
getch();
return 0;
}
/*...*/
#include<stdio.h> int main(void)
{
float c,f;
int choice; printf("1 for centigrade to fahrenheit"
"\n2 for fahrenheir to centigrade");
scanf("%d",&choice); if (choice=1)
{
printf("please input the temperature");
scanf("%f",&c);
f=c*1.8+32L;
printf("%.2f",f);
}
else
{
printf("please input the temperature");
scanf("%f",&f);
c=(f-32)*5/9l;
printf("%.2f",c);
}
getch();
return 0;
}
