Advertisement
alicemiriel

Untitled

Mar 31st, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. public class FirstSample {
  5.  
  6.     public static void main(String[] args) {
  7.  
  8.         int x = 3;
  9.         while (x>0) {
  10.  
  11.             if (x >2){
  12.                 System.out.print("a");
  13.             }
  14.             x= x -1;
  15.             System.out.print("-");
  16.            
  17.             if (x == 2){
  18.                 System.out.print("b c");
  19.             }
  20.             if (x == 1) {
  21.                 System.out.print("d");
  22.                 x= x-1;}
  23.  
  24.  
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement