mirror of
https://github.com/MunGell/awesome-for-beginners.git
synced 2026-01-27 13:58:07 -08:00
Merge e318cd5381 into 93d61be802
This commit is contained in:
21
FullNumberPyramid.java
Normal file
21
FullNumberPyramid.java
Normal file
@@ -0,0 +1,21 @@
|
||||
import java.util.*;
|
||||
public class FullNumberPyramid {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Scanner sc=new Scanner(System.in);
|
||||
int n=sc.nextInt();
|
||||
int c=1;
|
||||
for(int i=1;i<=n;i++) {
|
||||
for(int j=1;j<=n-i;j++)
|
||||
{
|
||||
System.out.print(" ");
|
||||
}
|
||||
for(int k=1;k<=i;k++)
|
||||
{
|
||||
System.out.print(c++ +" ");
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user