fork(1) download
  1. import java.util.*;
  2. import java.io.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. Scanner leer =new Scanner (System.in);
  9. int T=leer.nextInt();
  10. for (int j = 0; j < T; j++) {
  11. int suma=0;
  12.  
  13. int num = Integer.parseInt(leer.next());
  14.  
  15. while (num > 0) {
  16. suma+= num % 10;
  17. num = num / 10;
  18. }
  19. System.out.println(suma % 2 == 0);
  20. }
  21. }
  22. }
Success #stdin #stdout 0.1s 35540KB
stdin
3
2
246
7
stdout
true
true
false