anagram

    -1熱度

    1回答

    即時通訊第一年的程序員,我想知道這是什麼代碼提取做。它是檢查兩個單詞是否是另一個單詞的主要部分。我不完全確定這代表了什麼。 for(int x = 0; x < array.length; x++) { if(x == array.length-1) { array[x] = word1.substring(x); } els

    6熱度

    4回答

    給定兩個字符串,我想確定它們是否是另一個字符串。這裏是我想出的解決方案: # output messages def anagram puts "Anagram!" exit end def not_anagram puts "Not an anagram!" exit end # main method if __FILE__ == $0

    2熱度

    3回答

    在我的許多幫助下,我開發了一種方法來製作anagrams,然後將它們添加到ArrayList中。 public void f(String s, String anagram, ArrayList<String> array) { if(s.length() == 0) { array.add(anagram); return; }

    1熱度

    3回答

    我有兩個ArrayList<String> s。一個包含標點符號和大寫字母,另一個則刪除。 列表1: File word: it's File word: Sit File word: yes-man File word: murdered File word: ok File word: DereDrum File word: Hello File word: Friend 列

    -4熱度

    4回答

    鑑於串... able\nacre\nbale\nbeyond\nbinary\nboat\nbrainy\ncare\ncat\ncater\ncrate\nlawn\nlist\nrace\nreact\nsheet\nsilt\nslit\ntrace\n 我試圖弄清楚如何將每個單詞指定字符串中的變量,然後按字母順序排序的每個字,這將使我比較他們看哪些是anagrams,哪些不是。如果可以的

    0熱度

    6回答

    下面是我寫的用於放置彼此相鄰的所有字謎,字符串集合中的代碼。 輸出未按預期排序。實際上,輸出與輸入相同。 我哪裏錯了? package set2; import java.util.Arrays; import java.util.Comparator; public class printAllAnagrams { public static void main(String

    1熱度

    2回答

    我有這個代碼,我脫離了互聯網。它所做的是檢查兩個字符串是否是字謎。這基本上意味着它們具有相同數量的字母和相同的字母數量。例如,「廢料」和「胡扯」或「聽到」和「野兔」。等等。無論如何,我的問題是,我不明白它是如何工作的。如果任何人都可以給我一點見解,這將有所幫助!謝謝你的時間傢伙!我很感激!以下是代碼 具體說明。我沒有得到for循環部分。 boolean isAnagram(string s1, s

    1熱度

    1回答

    我的程序從用戶處獲取兩個輸入,並確定它們是否是對方的字典,但是我得到了輸入並按照字母順序排序了它們但不確定如何比較它們打印出來,如果他們是相同的或不繼承人我的代碼顯然是串==字符串是不正確 #include <stdio.h> #include <stdlib.h> #include <string.h> void sort_string(char*); int main() {

    2熱度

    1回答

    http://spark-university.s3.amazonaws.com/berkeley-saas/homework/hw1.pdf 試圖參與本作業的第3部分。下面的代碼似乎沒有工作,即對參數['HeLLo', 'hello'],返回[["hello"], ["HeLLo"]]代替[["HeLLo", "hello"]] def combine_anagrams(words)

    3熱度

    2回答

    我正在製作一個ios應用程序,您在其中輸入9個字母並輸出這9個字母的字母。它就像是紙上的目標詞,或9個字母的單詞。像這樣的鏈接: http://nineletterword.tompaton.com/ 它不只是爲9個字母提供字謎,它會做它的4個字母,5個字母,6個字母......所有這些都至少包含字母中間。 我想使它成爲離線應用程序,所以我不想引用任何網站或使用在線JSON ... 我怎麼會去檢查