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. int arr_all[] = new int[100];
  13. int i = 0;
  14. for (; i < 100; i++) {
  15. arr_all[i] = i + 1;
  16. }
  17. int out = 0;
  18. i = 0;
  19. int count = 0;
  20. while (out <= 50)
  21. {
  22. if (arr_all[i % 100] != 0)
  23. {
  24. count++;
  25. if (count % 7 == 0)
  26. {
  27. out++;
  28. System.out.println(arr_all[i % 100]);
  29. arr_all[i % 100] = 0;
  30. count = 0;
  31. }
  32. }
  33. i++;
  34. }
  35. }
  36. }
Success #stdin #stdout 0.11s 320512KB
stdin
Standard input is empty
stdout
7
14
21
28
35
42
49
56
63
70
77
84
91
98
5
13
22
30
38
46
54
62
71
79
87
95
3
12
23
32
41
51
60
69
80
89
99
9
19
31
43
53
65
75
86
97
10
24
36
48
61