filipparodriguezz

Untitled

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