Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int num = scanner.nextInt();
- for (int i = 1; i <= num; i++) {
- for (int j = 1; j <= i ; j++) {
- System.out.print(i + " ");
- if (j == i) {
- System.out.printf("%n");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment