package segitigapascal;
public class Main {
public static void main(String[]
args) {
int n = 5, j,k;
String tampil =
"";
for (int i=1; i<=n;
i++){
for(j=n; j>i; j--){
tampil += "
";
}
for(k=1; k<=i; k++){
tampil +=
"1 ";
}
tampil +=
"\n";
}
System.out.print(tampil);
}
}
1 komentar:
Posting Komentar