fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. int i = 0;
  14. boolean found = false;
  15. while(i<10 && !found)
  16. {
  17. i++;
  18. System.out.print( i +"=i ");
  19. int j = i* i;
  20. System.out.print(j + "=j " );
  21. if ((i*i*i)% j == j)
  22. {
  23. found = true;
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32. }
  33.  
  34.  
  35. }
  36. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
1=i  1=j 2=i  4=j 3=i  9=j 4=i  16=j 5=i  25=j 6=i  36=j 7=i  49=j 8=i  64=j 9=i  81=j 10=i  100=j