Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public static void main(String[] args) {
  2.  
  3. for(int i = 1; i <= 200; i++){
  4.  
  5. if(i%5==0 && i%3==0){
  6. System.out.println("M35");
  7. } else {
  8. if (i % 3 == 0) {
  9. System.out.println("M3");
  10. }
  11. if (i % 5 == 0) {
  12. System.out.println("M5");
  13. }
  14.  
  15. if (i % 5 != 0 || i % 3 != 0) {
  16. System.out.println(i);
  17. }
  18.  
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement