-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
64 lines (51 loc) · 1.1 KB
/
main.cpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
#include<stdio.h>
//#include "klee/klee.h"
#define INVAILD -1
#define NOT_TRIANGLE -2
#define TRIANGLE 0
#define EQUILATERAL 1
#define ISOSCELES 2
void swap(int t, int x, int y){
t = x;
x = y;
y = t;
}
int triangle_type(int x, int y, int z){
//check invaild
if (1 > x || x > 200 )
return INVAILD;
if (1 > y || y > 200 )
return INVAILD;
if (1 > z || z > 200 )
return INVAILD;
//sort 3 value
int t;
if (x > y)
swap(t, x, y);
if (y > z)
swap(t, y, z);
if (x > y)
swap(t, x, y);
//not_triangle
if (z >= x + y )
return NOT_TRIANGLE;
//equilateral
if (x == y && y == z)
return EQUILATERAL;
//isosceles
if (x == y || y == z)
return ISOSCELES;
return TRIANGLE;
}
int main()
{
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
//klee_make_symbolic(&a, sizeof(a), "a");
//klee_make_symbolic(&b, sizeof(b), "b");
//klee_make_symbolic(&c, sizeof(c), "c");
int ans;
ans = triangle_type(a, b, c);
printf("%d\n", ans);
return 0;
}