回复 楼主 wackyjason
楼主的程序做最小的改动,如下:程序代码:
#include <stdio.h> int main (void) { float mile, gallon; printf ("Please enter your mile and gallon: ",mile,gallon); scanf ("%f %f", &mile, &gallon); const float L = 3.785 * gallon; const float KM = 1.609 * mile; printf ("Your car run %.1f mile per gallon.\n", mile / gallon); printf ("Which mean your car cost %.1f L per 100KM.\n", L *100 / KM); return 0; }
然后结果应该是:
Please enter your mile and gallon: 500 10
Your car run 50.0 mile per gallon.
Which mean your car cost 4.7 L per 100KM.
Coding就像一盒巧克力,你永远不会知道你会遇到什么BUG
别跟我说你是不能的,这让我愤怒,因为这侮辱了你的智慧