编写JAVA程序:利用ASCII码输出如下图形 A BB CCC DDDD

2025-01-07 17:35:36
推荐回答(2个)
回答1:

import java.util.Scanner;
public class Example{
public static void main(String args[]){
char ch=65;
Scanner input=new Scanner(System.in);
System.out.println("请输入你要打印的层数:");
int n=input.nextInt();
for(int i=0;i for(int j=0;j System.out.print((char)(ch+i));
System.out.print("\n");
}
}
}

回答2:

BUG