fork(3) download
  1. package javaapplication4;
  2. import java.util.Scanner;
  3.  
  4. public class JavaApplication4 {
  5. public static void main(String[] args)
  6. {
  7. Scanner odczyt = new Scanner(System.in);
  8. int q = odczyt.nextInt();
  9. for(int i =1; i<=q;i++)
  10. {
  11. Pierwsza liczba = new Pierwsza();
  12. Scanner input = new Scanner(System.in);
  13. int n;
  14. n = input.nextInt();
  15. liczba.test(n);
  16. }
  17. }
  18.  
  19. static class Pierwsza
  20. {
  21. public void test(int n)
  22. {
  23. int x = 2;
  24. int sum = 0;
  25. if (n != 1)
  26. {
  27. etykieta: while (x < n) {
  28. if (sum == 0) {
  29. if (n % x == 0) {
  30. sum++;
  31. x++;
  32. } else x++;
  33. } else {
  34. System.out.println("NIE");
  35. break;
  36. }
  37. }
  38. if (sum == 0) System.out.println("TAK");
  39. } else System.out.println("NIE");
  40. }
  41. }
  42. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:4: error: class JavaApplication4 is public, should be declared in a file named JavaApplication4.java
public class JavaApplication4 {
       ^
1 error
stdout
Standard output is empty