#include <stdio.h>
int main()
{
char c = '97';
int n =c; //将c赋值给n
float f =c; //将c赋值给f
double d =c; //将c赋值给d
printf("%d\n",n);
printf("%f\n",f);
printf("%lf\n",d);
return 0;
}
刚才回答错了,你应该把char那行改为char c=97
#include <stdio.h>
int main()
{
char c = 'a';
int n=c ; //将c赋值给n
float f =c; //将c赋值给f
double d =c; //将c赋值给d
printf("%d\n",n);
printf("%f\n",f);
printf("%lf\n",d);
return 0;
}
哪里有问题?
97是字符?
重置一下代码
{
char c = 'a';
int n = c; //将c赋值给n
float f = c; //将c赋值给f
double d = c; //将c赋值给d
printf("%d\n",n);
printf("%f\n",f);
printf("%lf\n",d);
return 0;
}
你少了一行,沒有把其它几个字符输进去
你尝试把10行的%If写正确试试