GoralWMoro

Untitled

Apr 3rd, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. public class foobar {
  2.  
  3.     public static void main(String[] args) {
  4.         for(int i = 1; i <= 50; i++){
  5.  
  6.             if(i % 3 == 0){
  7.                 System.out.println(i + " foo");
  8.             }else if(i % 5 == 0){
  9.                 System.out.println(i + " bar");
  10.             }else if(i % 7 == 0){
  11.                 System.out.println(i + " baz");
  12.             }else{
  13.                 System.out.println(i);
  14.             }
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment