-2
我試圖在輸入一個單詞(例如,火)的地方製作一個Anagram益智遊戲,並且它隨機地爲我加擾(最終它像「rfie」,「frei」等等......)下面是我想要做的基礎知識。我只需要知道如何打亂字符串。如何爭奪一個字符串
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Input word");
String Word = sc.nextLine();
//Program jumbles word here
System.out.println(Word);
//Jumbled word is printed one previous line
}
具有第一親自去。你可能會感到驚訝並且無需幫助就可以管理它順便說一句,在Java中的約定是本地變量以小寫字母開頭。類以大寫字母開頭。如果你遵循這個慣例,它有助於區分兩者。 – 2015-03-02 13:58:12