public class Test1 {
public static void main(String[] args) {
for (int i = 0; i < 26; i++) {
for (int j = 0; j < 26-1-i; j++) {
System.out.print(" ");
}
print(i,0);
System.out.println();
}
}
public static void print(int n,int index){
if(index<=n){
int position=(int)'A'+index;
System.out.print((char)(position));
print(n,index+1);
if(position!=(int)'A'+n)
System.out.print((char)(position));
}
else{
return;
}
}
}
|