Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- public static void main(String args[]) {
- java.util.Scanner scanner = new java.util.Scanner(System.in);
- int input = Integer.valueOf(scanner.nextLine());
- while (!(input >= 1 && input <= 20)) {
- input = Integer.valueOf(scanner.nextLine());
- }
- for(int i = 1; i <= input;i++) {
- for(int j = 0; j < i; j++) {
- System.out.print(i + " ");
- }
- System.out.print("\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement