亲,这样能行吗??
import java.util.Scanner;
public class Test1 {
public static void main(String args[]){
int height;
String zifu;
System.out.print("请输入行高:");
Scanner in=new Scanner(System.in);
height=in.nextInt();
System.out.print("请输入打印的字符:");
zifu=in.next();
print(height,zifu);
}
public static void print(int height,String zf)
{
for(int i=0;i{
for(int j=0;j<=i;j++)
{
System.out.print(zf.charAt(0));
}
System.out.println();
}
}
}
希望能帮到你,还望采纳