C++ 3integers can form 3 sides of triangle,pls help mi,i realli need help!!!!?
i just cnnot gt the (4,5,6) to be a triangle,
(8,8,8) to be equilateral n isosceles triangle.
include<iostream>
#include <iomanip>
using namespace std;
int main ()
{
int A,B,C, // 3 side lengths for triangle
S;
cout << "This program determines the type of triangle from the side lengths";
//Input 3 sides of triangle
cout << "\n\nEnter length of side A: ";
cin >> A;
cout << "\nEnter length of side B: ";
cin >> B;
cout << "\nEnter length of side C: ";
cin >> C;
//Determine the triangle types based on side equality
if ((A>0) && (B>0) && (C>0))
{
S=1;
}
else if((A>=0) && (B>=0) || (C>=0))
{
S=2;
}
else if((A ==

|| (B == C) || (A == C))
{
S=3;
}
else if ((A ==

&& (B == C))
{
S=4;
}
switch (S)
{
case 1:cout << "(" << A << "," << B << "," << C << ")is not a triangle" << endl;
break;
case 2:cout << "(" << A << "," << B << "," << C << ")is a triangle" <<endl;
break;
case 3:cout << "(" << A << "," << B << "," << C << ")is an equilateral triangle" <<endl;
break;
case 4:cout << "(" << A << "," << B << "," << C << ")is an isosceles triangle" <<endl;
break;
default:cout << "unknown";
break;
}
return 0;
}
output:
Enter 3 integers:4 5 6
(4,5,6) is a triangle
Enter 3 integers: 8 8 8
(8,8,8) is an equilateral triangle
(8,8,8) is an isosceles triangle
(8,8,8) is a triangle