#include <stdio.h>
int main()
{ int a=97;float f; double d;
char c = 'a';
int n;
n=c; //将c赋值给n
f=c; //将c赋值给
d=f; //将c赋值给d
printf("%d\n",n);
printf("%f\n",f);
printf("%.8f\n",d);
return 0;
}
#include <stdio.h>
int main()
{ int a=97;
char c = 'a';
int n; //将c赋值给n
n=c;
float f; //将c赋值给f
f=n;
double d; //将c赋值给d
d=f;
printf("%d\n",n);
printf("%f\n",f);
printf("%lf\n",d);
return 0;
}
变量声明一定要声明在最前面,不能在中间,这是C语言的规则
第二种可以运行,不过书写不够规范