質問編集履歴
2
抹消された内容の復元
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,10 +14,74 @@
|
|
14
14
|
|
15
15
|
```
|
16
16
|
|
17
|
-
e
|
17
|
+
#define _CRT_SECURE_NO_WARNINGS
|
18
18
|
|
19
|
-
|
19
|
+
#include <stdio.h>
|
20
20
|
|
21
|
+
int main(void) {
|
21
22
|
|
23
|
+
int a, b, c;
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
printf("Input the lenghts of the sides of the triangle: ");
|
28
|
+
|
29
|
+
while (1) {
|
30
|
+
|
31
|
+
scanf("%lf", &a);
|
32
|
+
|
33
|
+
scanf("%lf", &b);
|
34
|
+
|
35
|
+
scanf("%lf", &c);
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
if ((a == b) && (b == c)) {
|
40
|
+
|
41
|
+
printf("3 (equilateral)\n");
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
else if ((a == b || a == c || b == c)) {
|
48
|
+
|
49
|
+
printf("2 (isosceles)\n");
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
else if (a + b >= c && b + c >= a && c + a >= b) {
|
56
|
+
|
57
|
+
if (a != b != c) {
|
58
|
+
|
59
|
+
printf("1 (scalene)\n");
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
else if (a + b<c || a + c<b || b + c<a) {
|
70
|
+
|
71
|
+
printf("0 (not a valid triangle)\n");
|
72
|
+
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
return(0);
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
}
|
22
86
|
|
23
87
|
```
|
1
省略
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,76 +12,12 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
```
|
15
|
+
```
|
16
16
|
|
17
|
+
else if (a + b<c || a + c<b || b + c<a) {
|
18
|
+
|
17
|
-
|
19
|
+
printf("0 (not a valid triangle)\n");
|
18
20
|
|
19
21
|
|
20
22
|
|
21
|
-
int main(void) {
|
22
|
-
|
23
|
-
int a, b, c;
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
printf("Input the lenghts of the sides of the triangle: ");
|
28
|
-
|
29
|
-
while (1) {
|
30
|
-
|
31
|
-
scanf("%lf", &a);
|
32
|
-
|
33
|
-
scanf("%lf", &b);
|
34
|
-
|
35
|
-
scanf("%lf", &c);
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
if ((a == b) && (b == c)) {
|
40
|
-
|
41
|
-
printf("3 (equilateral)\n");
|
42
|
-
|
43
|
-
}
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
else if ((a == b || a == c || b == c)) {
|
48
|
-
|
49
|
-
printf("2 (isosceles)\n");
|
50
|
-
|
51
|
-
}
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
else if (a + b >= c && b + c >= a && c + a >= b) {
|
56
|
-
|
57
|
-
if (a != b != c) {
|
58
|
-
|
59
|
-
printf("1 (scalene)\n");
|
60
|
-
|
61
|
-
}
|
62
|
-
|
63
|
-
}
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
else if (a + b<c || a + c<b || b + c<a) {
|
70
|
-
|
71
|
-
printf("0 (not a valid triangle)\n");
|
72
|
-
|
73
|
-
}
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
return(0);
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
}
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
}
|
86
|
-
|
87
23
|
```
|