Vigenere算法c语言的简单实现#includemain(){inti,j,m,n,c,k,Ming_length,Key_length;charvigenere_table[26][26];charKey[200],Ming[500],Mi[200],s[26][26];printf("VigenereTable:\n");for(j=0;j<=25;j++){printf("%c\n",'a'+j);for(i=0;i<=25;i++){vigenere_table[i][j]='A'+(i+j)%26;printf("%c",vigenere_table[i][j]);}}printf("\n");for(i=0;i<=25;i++){printf("%c",'a'+i);}printf("\n");printf("QingshuruMingwen:\n");gets(Ming);printf("QingshuruMiyao:\n");gets(Key);Ming_length=strlen(Ming);Key_length=strlen(Key);printf("\n");k=0;printf("mingwenshi\n");do{for(j=k;j<k+Key_length;j++){intm=Ming[j];intn=Key[j-k];printf("%c",vigenere_table[m-97][n-97]);}k+=Key_length;}while(k<Ming_length);getch();}
1