fork download
  1. #include <stdio.h>
  2. int tongchuso (int n) {
  3. int s = 0;
  4. while (n > 0) {
  5. s += n % 10;
  6. n /= 10;
  7. }
  8. return s;
  9. }
  10. int main(void) {
  11. int n, a;
  12. scanf("%d", &n);
  13. for (int i = 0; i < n; i++){
  14. scanf ("%d", &a);
  15. if (tongchuso(a) % 10 == 0) {
  16. printf ("YES\n");
  17. }
  18. else {printf ("NO\n");}
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5272KB
stdin
3
3333
555555
123455
stdout
NO
YES
YES