题解 | #字符金字塔#
字符金字塔
http://www.nowcoder.com/practice/0fae60c3b5c64699b7c0f031c2187dde
import java.util.*;
public class Main{
public static void print(){
Scanner scanner=new Scanner(System.in);
String c=scanner.nextLine();
for(int i=0;i<5;i++){
for(int k=4-i;k>=1;k--){
System.out.print(" ");
}
for(int j=0;j<=i;j++){
System.out.print(c+" ");
}
System.out.println();
}
}
public static void main(String[] args) {
print();
}
}