Babelfish,babelfishpoj

來源:互聯網
上載者:User

Babelfish,babelfishpoj

題目連結

  • 簡單的字串HASH題目,關鍵學習一下黑書的字串elfhash

const int MAXN = 100010;const int maxn=1000000;const int maxm=100003;const int maxlen=20;class hash{    private:    struct node{        char ch[maxlen];        int ptr;        node* next;    };    node *h[maxm],s[maxn];    int numptr;    int Hash(char *key)    {        unsigned long h=0,g;        while(*key)        {            h=(h<<4)+*key++;            g=h&0xf0000000L;            if(g)h^=g>>24;            h&=~g;        }        return h%maxm;    }    public:    void init()    {        int i;        for(i=0;i<maxm;i++)h[i]=NULL;        numptr=0;    }    int ins(char ch[])    {        int temp=Hash(ch);        strcpy(s[numptr].ch,ch);        s[numptr].next=h[temp];        s[numptr].ptr=numptr;        h[temp]=&s[numptr];        numptr++;        return numptr-1;    }    int question(char ch[])    {        int temp=Hash(ch);        node* ptr=h[temp];        while(ptr)        {            if(strcmp(ptr->ch,ch)==0)            {                return ptr->ptr;            }            ptr=ptr->next;        }        return -1;    }} hash;char ipt[30], a[20], b[20];char ans[MAXN][20];int main (){    hash.init();    while (gets(ipt) && ipt[0] != 0)    {        sscanf(ipt, "%s %s", a, b);        int hs = hash.ins(b);        strcpy(ans[hs], a);    }    while (gets(ipt) && ipt[0] != 0)    {        int hs = hash.question(ipt);        if (hs != -1)            printf("%s\n", ans[hs]);        else            puts("eh");    }    return 0;}/*dog ogdaycat atcaypig igpayfroot ootfrayloops oopslayatcayittenkayoopslaySample Outputcatehloops*/



巴別魚 英語是什東東

巴別魚私人外語學習系統(BabelFish Language Learning System)是一個使學習者能夠隨時隨地、輕鬆快樂地學習並真正能夠掌握運用一門語言的學習系統。 巴別魚這個名稱來自於道格拉斯·亞當斯的《銀河系漫遊指南》系列小說,它是一個能協助人聽懂任意一種語言的虛構物種:
巴別魚體型很小,黃色,外形像水蛭,很可能是宇宙中最奇異的事物。它靠接收腦電波的能量為生,並且不是從其攜帶者身上接收,而是從周圍的人身上。它從這些腦電波能量中吸收所有未被人察覺的精神頻率,轉化成營養。然後他向攜帶者的思想中排泄一種由被感覺到的精神頻率和大腦語言中樞提供的神經訊號混合而成的心靈感應矩陣。所有這些過程的實際效果就是,如果你把一條巴別魚塞進耳朵,你就能立刻理解以任何形式的語言對你說的任何事情,你所聽到的解碼訊號就是巴別魚向你的思想提供的腦電波矩陣。
 
哪個線上翻譯比較好用?

GOOGLE和雅虎都一般
你可以再看看Babel Fish Translation網址是babelfish.altavista也還可以
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.