Advertisement
Stelios_Gakis

Seminar_1/Task_3

Sep 15th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. package Seminar_1;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Task_3 {
  6.     public static void main(String[] args){
  7.  
  8.         Scanner input = new Scanner(System.in);
  9.         int rows, columns;
  10.  
  11.         System.out.print("specify number of rows: ");
  12.         rows = input.nextInt();
  13.         System.out.print("Specify number of columns: ");
  14.         columns = input.nextInt();
  15.  
  16.         for (int i = 0; i < rows; i++) {
  17.             for (int j = 0; j < columns; j++){
  18.                 System.out.print("x");
  19.             }
  20.             System.out.printf("%n");
  21.         }
  22.  
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement