?? 1_trip.c
字號:
/**
* 上機作業1:旅游良伴
* http://cms.hit.edu.cn/mod/assignment/view.php?a=118
*
* 華氏溫度與攝氏溫度互相轉換。
*
* Copyright: Public domain
* Author: Sunner Sun
* Organization: 哈爾濱工業大學(Harbin Institute of Technology)
* Date: 2006-11-05-15.31
*/
#include <stdio.h>
int main()
{
int way; /* 轉換方向 */
float x; /* 被轉換的數 */
while (scanf("%d", &way) == 1 && way != -1)
{
scanf("%f", &x);
if (way == 1)
printf("The Centigrade is %.2f\n", (x - 32) * 5 / 9.0);
else
printf("The Fahrenheit is %.2f\n", 9.0 / 5 * x + 32);
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -