Skip to content

Commit

Permalink
Update Soluton_Bad_Triangles
Browse files Browse the repository at this point in the history
  • Loading branch information
ritwiksingh21 authored Oct 8, 2020
1 parent 01b6985 commit 53471b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Bad Triangle/Soluton_Bad_Triangles
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
int main()
{
int t,i,n,count;
scanf("%d", &t); #Taking the input from user
scanf("%d", &t); //Taking the number of test cases as input.
while(t--){
count = 0;
scanf("%d", &n);
scanf("%d", &n); // taking size of array as input.
int arr[n];
for(i=0;i<n;i++){
scanf("%d", &arr[i]); #filling up the array
scanf("%d", &arr[i]); //filling up the array
}
//checking for validity of triangle
for(i=2;i<n;i++){
if(arr[0]+arr[1]<= arr[i]){
count++;
Expand Down

0 comments on commit 53471b4

Please sign in to comment.