Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int N = Integer.parseInt(sc.nextLine());
- for (int i =1; i<=N;i++){
- System.out.println("");
- for (int j = 1; j<=N;j++) {
- System.out.print(j+" ");
- for (int k = i-1; k >=1 ; k--) {
- System.out.println(j+" ");
- j++;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement