카테고리 없음
화씨,섭시 변경
Ohmaigoodz
2019. 9. 26. 15:03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
double Fah, Cel;
double fahToCel(double Cel);
double celToFah(double Fah);
int main() {
char ask;
printf("If you want to change Fah to Cel enter F ,and if you want to change Cel to Fah enter C\n");
while (1) {
scanf("%c", &ask);
if (ask == 'F') {
printf("Enter Degree: ");
scanf("%lf", &Fah);
printf("Fah to Cel result is %lf to %lf degree\n", Fah, fahToCel(Fah));
break;
}
else if (ask == 'C') {
printf("Enter Degree: ");
scanf("%lf", &Cel);
printf("Cel to Fah result is %lf to %lf degree\n", Cel, celToFah(Cel));
break;
}
else {
printf("Error case enter again :\n");
scanf("%c", &ask);
}
}
}
double celToFah(double Cel) {
double Fah = 1.8 * Cel + 32;
return Fah;
}
double fahToCel(double Fah) {
double Cel = (Fah - 32) / 1.8;
return Cel;
}
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |