fork(1) 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 Main
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. for (int i = 3; i < 1000; i = i + 3) {
  13. int sum = 0;
  14. int temp = i;
  15. while (temp > 0) {
  16. sum += temp % 10;
  17. temp /= 10;
  18. }
  19. if ((i % 5 != 0) && (sum < 10)) {
  20. System.out.println(i);
  21. }
  22. }
  23. }
  24. }
Success #stdin #stdout 0.1s 27812KB
stdin
Standard input is empty
stdout
3
6
9
12
18
21
24
27
33
36
42
51
54
63
72
81
102
108
111
114
117
123
126
132
141
144
153
162
171
201
204
207
213
216
222
231
234
243
252
261
303
306
312
321
324
333
342
351
402
411
414
423
432
441
501
504
513
522
531
603
612
621
702
711
801