華氏溫度轉攝氏溫度- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- float degree;
- printf("輸入華氏溫度: \n");
- scanf("%d",°ree);
- printf("100F=%fC\n", (degree-32.0)*5.0/9.0);
- system("pause");
- return 0;
- }
複製代碼
攝氏溫度轉華氏溫度- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- float degree;
- printf("輸入攝氏溫度: \n");
- scanf("%d",°ree);
- printf("100C=%fF\n", degree*9.0/5.0+32.0);
- system("pause");
- return 0;
- }
複製代碼 ... |