mirror of
https://github.com/MunGell/awesome-for-beginners.git
synced 2026-05-06 15:50:03 -07:00
Compare commits
2 Commits
main
...
644b4d9808
| Author | SHA1 | Date | |
|---|---|---|---|
| 644b4d9808 | |||
| e318cd5381 |
@@ -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