Advertisement
Diene

Untitled

Mar 20th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. int X,R,N,L;
  8. int contador=0;
  9. char c,c1,c2,c3;
  10.  
  11. scanf("%d;", &X);
  12.  
  13. for(int i=0; i<X; i++){
  14.     scanf("%d,%d,%d;", &R,&N,&L);
  15.     if(N==3 && L<=R){
  16.         contador++;
  17.     }
  18.     else if(N==4 && L<=sqrt(2)*R){
  19.         contador++;
  20.     }
  21. }
  22.  
  23. printf("%d\n", contador);
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement