-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpg1.cpp
55 lines (55 loc) · 1.19 KB
/
pg1.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
#include<iostream>
#include<stdlib.h>
#include<ctype.h>
using namespace std;
int main(int argc,char* argv[])
{
int a,b,c,d;
//while(1)
//{
//cout<<"enter the 3 side in seperate lines"<<endl;
//cin>>a>>b>>c;
a=atoi(argv[1]);
b=atoi(argv[2]);
c=atoi(argv[3]);
//if(a!=0 && b!=0 && c!=0)
//{
if((a<1||a>10)&&(b<1||b>10)&&(c<1||c>10))
cout<<"a,b,c are out of range.\n";
else if((a<1||a>10)&&(b<1||b>10))
cout<<"a,b are out of range.\n";
else if((b<1||b>10)&&(c<1||c>10))
cout<<"b,c are out of range.\n";
else if((a<1||a>10)&&(c<1||c>10))
cout<<"a,c are out of range.\n";
else if(a<1||a>10)
cout<<"a is out of range.\n";
else if(b<1||b>10)
cout<<"b is out of range.\n";
else if(c<1||c>10)
cout<<"c is out of range.\n";
else
{
if(a<(b+c) && b<(c+a) && c<(a+b))
{
if(a==b && b==c)
cout<<"Equilateral triangle"<<endl;
else if(a!=b && b!=c && a!=c)
cout<<"Scalene triangle"<<endl;
else
cout<<"Isosceles triangle"<<endl;
}
else
cout<<"cannot form a triangle"<<endl;
}
//}
/*else
break;
cout<<"enter 0 to exit 1 to continue"<<endl;
cin>>d;
if(d==0)
exit(0);
else
continue;*/
//}
}