Tuesday, January 21, 2020

Codeforces Problem 231A Team Solution in C



  1. #include<stdio.h>
  2. int main()
  3. {
  4. int i,j,a,b,c,x,y=0;
  5. scanf("%d",&i);
  6. if (i>0 && i<=1000)
  7. {
  8. for (j=0; j<i; j++)
  9. {
  10. scanf("%d %d %d",&a,&b,&c);
  11. if ((a==1 || a==0) && (b==1 || b==0) && (c==1 || c==0))
  12. {
  13. x=a+b+c;
  14. if (x>=2) y++;
  15. }
  16. }
  17. printf("%d\n",y);
  18. }
  19. return 0;
  20. }

No comments:

Post a Comment

Codeforces 131A cAPS lOCK Solution in C

#include <stdio.h> int main () { char ch [ 106 ]; int i , j , ck = 1 ; scanf ( "%s" , ch ); ...