Advertisement
lol1234561

Untitled

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