import java.util.Scanner;
public class Hw6 {
public Hw6() {
}
static Scanner cin(){
return new Scanner(System.in);
}
static void out(String x){
System.out.print(x);
}
public static void main(String[] args) {
int i,j,n;
out("Please Input N= "); n=cin().nextInt();
for(i=n;i>=1;i--)
{
for(j=0;j<n-i;j++)
out(" ");
for(j=1;j<=i;j++)
out(Integer.toString(j));
System.out.println();
}
}
}
+Output
No comments:
Post a Comment