課程
/后端開發
/C
/C語言入門
#include
2017-01-26
源自:C語言入門 3-1
正在回答
int a,b,c,d改成float a,b,c,d
怎么修改能得到3.750000
#include<stdio.h>
int main()
{
? ? float a,b,c,d;?
? ? double result;
? ? a = 1;
? ? b = 2;
? ? c = 3;
? ? d = 4;
? ? result = a+ b+ c/d;??//你定義的是整形,c/d結果取整,所以答案是3
? ? printf("%f\n", result);
? ? return 0;
}?
舉報
C語言入門視頻教程,帶你進入編程世界的必修課-C語言
1 回答輸出結果老不對
3 回答輸出結果不對,也過關了?
1 回答這輸出怎么不對啊,輸入9 12 結果不正確,哪錯了
1 回答這個為什么輸出結果不對
3 回答為什么我的輸出結果不對
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-03-19
int a,b,c,d改成float a,b,c,d
2017-03-11
怎么修改能得到3.750000
2017-01-26
#include<stdio.h>
int main()
{
? ? float a,b,c,d;?
? ? double result;
? ? a = 1;
? ? b = 2;
? ? c = 3;
? ? d = 4;
? ? result = a+ b+ c/d;??//你定義的是整形,c/d結果取整,所以答案是3
? ? printf("%f\n", result);
? ? return 0;
}?