Advertisement
alicemiriel

Untitled

Mar 31st, 2016
64
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.             if (x >2){
  11.                 System.out.print("a");
  12.             }
  13.             if (x == 2){
  14.                 System.out.print("b c");
  15.             }
  16.             if (x == 1) {
  17.                 System.out.print("d");
  18.                 x= x-1;
  19.             }
  20.             x= x -1;
  21.             System.out.print("-");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement