fork download
  1. class IfHomeworkRedo {
  2.  
  3. public static void main (String[] args)
  4.  
  5. {
  6.  
  7. two(3, 3);
  8.  
  9. two(3, 4);
  10.  
  11. two(4, 3);
  12.  
  13. }
  14.  
  15. public static void two(int a, int b) {
  16.  
  17. if (a == b) {System.out.println(a*b);}
  18.  
  19. else if (a < b) {
  20.  
  21. for (int i = 0; i < 10; i++) {
  22.  
  23. System.out.println(a+b);
  24.  
  25. }
  26. }
  27.  
  28. else if (a > b) {
  29.  
  30. for (int i = 0; i < 50; i++) {
  31.  
  32. System.out.println(b-a);
  33.  
  34.  
  35.  
  36. }
  37.  
  38. }
  39.  
  40. }
  41.  
  42. }
  43.  
  44.  
  45.  
Success #stdin #stdout 0.1s 320256KB
stdin
Standard input is empty
stdout
9
7
7
7
7
7
7
7
7
7
7
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1