Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. public class smallestMultiple {
  2. public static void main(String[] args) {
  3. int i = 20;
  4. while (true)
  5. {if ( (i % 1 == 0) &&
  6. (i % 2 == 0) &&
  7. (i % 3 == 0) &&
  8. (i % 4 == 0) &&
  9. (i % 5 == 0) &&
  10. (i % 6 == 0) &&
  11. (i % 7 == 0) &&
  12. (i % 8 == 0) &&
  13. (i % 9 == 0) &&
  14. (i % 10 == 0) &&
  15. (i % 11 == 0) &&
  16. (i % 12 == 0) &&
  17. (i % 13 == 0) &&
  18. (i % 14 == 0) &&
  19. (i % 15 == 0) &&
  20. (i % 16 == 0) &&
  21. (i % 17 == 0) &&
  22. (i % 18 == 0) &&
  23. (i % 19 == 0) &&
  24. (i % 20 == 0) )
  25. {
  26. break;
  27. }
  28. i += 20;
  29. }
  30. System.out.println(i);
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement