我該怎麼做?用字母顯示單詞的字母
給我一個字>糖
小號
蘇
SUG
菅
糖
這是我到目前爲止:
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter a word:");
String word = scan.nextLine();
int length = word.length();
for(int number = 0; number < length; number++){
System.out.println(word.charAt(number));
}
}
這使得字顯示字母顯示。
*「我做了這件事,它使字顯示字母」* ...並不是你想要的? – MadProgrammer
不,它輸出這樣的: 小號 ü 摹 一個 爲r的不是s蘇SUG菅糖 –
路易,你真的應該通過點擊投票下的綠色對勾標記對您的問題的答案接受計數,如果答案幫助你是對的。 –