变量章节
代码#include <stdio.h>
int main()
{
int a;
char b;
float c;
double d;
a = 520;
b = 'F';
c = 3.14;
d = 3.141592653;
printf("鱼C创办的%d\n",a);
printf("i love %c小红包!\n",b);
printf("圆周率是:%.2f\n,"c);
printf("精准到后9位的圆周率是:%11.9f\n",d);
return 0;
}
测试输出:
test.c:17:40: error: expected ')'
printf("圆周率是:%.2f\n,"c);
^
test.c:17:15: note: to match this '('
printf("圆周率是:%.2f\n,"c);
^
1 error generated.
请问是什么问题 printf("圆周率是:%.2f\n,"c); 这一行错了,
应该是 printf("圆周率是:%.2f\n", c);你把逗号写引号里面了 已解决17行逗号写错地方
页:
[1]