Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6. import java.util.Scanner;
  7.  
  8. public class Main {
  9.     public static void main(String[] args) {
  10.         Scanner keyboard = new Scanner(System.in);
  11.  
  12.         System.out.println("Type in a message, and I'll display it five times.");
  13.         System.out.print("Message: ");
  14.         String message = keyboard.nextLine();
  15.  
  16.         int n = 0;
  17.         while (n < 5) {
  18.             System.out.println((n + 1) + ". " + message);
  19.             n++;
  20.         }
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement