Tuesday, January 21, 2020

Codeforces 69A Young Physicist Solution in C



  1. #include<stdio.h>
  2. int main()
  3. {
  4. int o,n,a,b,c,s,t,u;
  5. s=0;
  6. t=0;
  7. u=0;
  8. scanf("%d",&n);
  9. for (o=0; o<n; o++)
  10. {
  11. scanf("%d %d %d",&a,&b,&c);
  12. s=s+a;
  13. t=t+b;
  14. u=u+c;
  15. }
  16. if (s==0 && t==0 && u==0) printf("YES\n");
  17. else printf("NO\n");
  18. return 0;
  19. }

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 ); ...