English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

1.Write a program to convert a temperature in degrees Fahrenheit to
degrees Celsius.

以下是我寫的程式:

#include
int
main(void)
{
double F,C;
printf("please input Fahrenheit");
scanf("%lf",F);
C=9/5*(F-32);
printf("%lf",C);

return (0);
}

偵測沒錯誤的地方呀~~~
可是執行不出來= ="...
一直跳出立即中止的視窗......= =
請幫我看看喲~~~~謝謝!!


下一題是我不會的.....
它在說瞎咪哇溝殺攏磨= =".....
請會的人寫寫看...讓我參考參考...

2.Write a program to take two numbers as input data and display their
sum,their difference,their product,and their quotient.



感恩喔^^~~~!!!

2007-10-20 19:22:20 · 3 個解答 · 發問者 ^^ 2 in 電腦與網際網路 程式設計

3 個解答

第一題
#include
int main(void)
{
double F,C;
printf("please input Fahrenheit: ");
scanf("%lf", &F);
C= 9/ 5 * ( F - 32 );
printf("%lf",C);

return 0;
}


第二題
#include

int main(void)
{
float num1, num2, sum, difference, product, quotient;

printf("please input first date: ");

scanf("%f", &num1);

printf("please input second date: ");
scanf("%f", &num2);

sum = num1 num2;

difference = num1 - num2;

product = num1 * num2;

quotient = num1 / num2;

printf("sum= %f difference= %f product= %f quotient= %f", sum,difference,product,quotient);

return 0;
}


我自己寫的 你看看是不是你所要的 有問題可以話 可以提出來討論

2007-10-20 19:50:37 · answer #1 · answered by 冠豪 4 · 0 0

給你提是一下吧
你的scanf("%lf",F); 錯誤示範
正確的scanf("%lf",&F);
你少了個&
就死了
這是很常見的錯誤
我也常常忘記

2007-10-22 07:32:43 · answer #2 · answered by 永恆的破壞 5 · 0 0

#include
#include
#define C(F) 5.0*(F-32)/9
int main(int argc, char* argv[]){
//=====START=====//
double f;
printf("Input Fahrenheit: "),scanf("%lf",&f);
printf("%lf F= %lf C\n",f,C(f));
//=====END=====//
system("PAUSE");
return 0;
}

2007-10-21 10:16:36 · answer #3 · answered by Big_John-tw 7 · 0 0

fedest.com, questions and answers