fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args)
  8. {
  9. int x; //описание переменных
  10. boolean mult1, mult2;
  11. System.out.printf("Enter x=\n");
  12. Scanner sc = new Scanner(System.in);
  13. x = sc.nextInt();
  14. mult1 = (x % 3 == 0);
  15. x=x/100+x/10%10+x%10;
  16. mult2 = (x % 3 == 0);
  17. if (mult1 == mult2) System.out.printf("not refuted"); //проверка признака
  18. else System.out.println("refuted");
  19. }
  20. }
Success #stdin #stdout 0.14s 321280KB
stdin
321
stdout
Enter x=
not refuted