编译出错,什么意思?double float a;printf("a=%df\n",10/3);[解决办法]楼主是想要有效数字或宽度吧? 参考这样就行:
printf("%.*f", 3, 10.0 / 3); printf("%*d", 3, 10 / 3);