供参考:
#include <stdio.h>
int main()
{
float c=0.0, f=0.0;
int i,j;
for(i=-30,j=1;i<=30;i+=5)
{
c=(float)i;
f = 9.0/5.0*c+32;
if(j==1) printf("%d\t摄氏温度\t华氏温度\n",j++);
printf("%d\t%8.2f\t%8.2f\n",j++,c,f);
}
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
float c, f;
scanf("%f", &c);
f = 9/5*c+32;
printf("%f" , f);
return 0;
}