求大神幫忙
{
??? int a,b,c,d;
??? int result;
??? a = 1;
??? b = 2;
??? c = 3;
??? d = 4;
??? result = a +b+? c+? d;??? //在這里體驗哦~
??? printf("%f\n", result);
??? return 0;
}
為什么答案是0
{
??? int a,b,c,d;
??? int result;
??? a = 1;
??? b = 2;
??? c = 3;
??? d = 4;
??? result = a +b+? c+? d;??? //在這里體驗哦~
??? printf("%f\n", result);
??? return 0;
}
為什么答案是0
2017-09-23
舉報
2017-09-23
result是整型數啊, 所以應該是printf("%d\n", result);
2017-09-23
你前面用的int定義 后面卻用%f 換成%d