PLzz help me with some critical inputs.
Code: Select all
GOT ACC
Moderator: Board moderators
Code: Select all
GOT ACC
Code: Select all
long a,b,c,t,count=1;
Code: Select all
Removed because Accepted
Code: Select all
Sorry for that post
Code: Select all
else if(t1+t2<t3||t1+t3<t2||t2+t3<t1)
puts("Scalene");
Code: Select all
Code: Select all
1
1 1 2
Code: Select all
#include<stdio.h>
int main()
{
long long int n,c=0,t1,t2,t3;
scanf("%lld",&n);
while(n--)
{
c++;
scanf("%lld %lld %lld",&t1,&t2,&t3);
printf("Case %lld: ",c);
if(t1<=0||t2<=0||t3<=0)
puts("Invalid");
else if(t1+t2<=t3||t2+t3<=t1||t1+t3<=t2)
puts("Invalid");
else if(t1==t2==t3)
puts("Equilateral");
else if(t1==t2||t2==t3||t1==t3)
puts("Isosceles");
else
puts("Scalene");
}
return 0;
}
A triangle is invalid if any side_length <= 0 or (sum of smaller 2 sides <= largest side).
A triangle is scalene if it is valid && all the sides are distinct.