-3
1
1 2 1
1 3 3 1
我提出的邏輯:
import java.io.*;
class pat {
public static void main(String[] args) throws IOException {
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
int n,p=0;
System.out.println("Enter value of n");
n=Integer .parseInt(in.readLine());
for(int i=0;i<n;i++)
{
for(int j=0;j<n-i;j++)
{
System.out.print(" ");
}
for(int k=0;k<=i;k++)
{
System.out.print((int)Math.pow(11,p));
}
System.out.println();
p++;
}
}
}
問題是...? – Andreas
我想,你錯過了一條[Pascal三角形]的'1 1'(https://en.wikipedia.org/wiki/Pascal%27s_triangle)。 –
請參閱如何發佈或提問 – karan