java如何在单词中的每个字符上返回一个字符?
例如,如果您键入happy,它将显示
h
a
p
p
y
现在我有这个:
public static void three(){
String x = keyb.next();
int y= x.length();
char [] word = new char [y];
System.out.println("It has " + y);
for (int i = 0; i < x.length(); i++) {
System.out.println(x);
}
}
这只会让这个词看起来有多少个字符。但我只想让每个字符本身缩进。请,谢谢
# 1 楼答案
就这么简单: