萌凤代码生成器&&解码器 ver.1.3
来源:程序员人生 发布时间:2015-04-22 08:11:33 阅读次数:3000次
[6]9[3]42[8]3[1][5]326[2]56[4][1]9[4]81[3][3]-[9]21[2]9[5][2]3161[-]53[1]6[4]5[6]37[9][9]-[3]7[8]8[3]9↓[-][8]3[1]1[3]0[1]55-[5]7[1]⑷[0]2[-][7]1[1]93[0]2⑷[1][9]⑵6[2]5[1]2[9]⑺4[9]4[1]9↑[-]7[7][4]4[5]⑷[3][1]4[5]7[4]9[5]33[0]4[7]53[1]92[4]8[0]9[2][6]⑸[0]9[5][5]0[5]35[1][4]5[1]4[7]42[9][4]5[6]39[5][2]5[8]0[5]34[0][5]6[8]4[1]5[6]4[5]2[5]⑺[0]4[9][1]94[0]671[1][8]0[1]-[6]15[3][1]91[2]8[5] =
=
↑[-][4]4[5]⑵2[9]-[4]86[8][7]4↑[-]7[7]1[8][2]34[2]5[3][6]⑼[-][9]1[4]96[4][9]-[7]6[9]0[1]4[1]-↑[-]534[7]7- http://tieba.baidu.com/p/2830159078
7[4]8[-][6]⑷[-][3]1[6]⑶1[2]7[2]3[6]6[3]-[9]⑴68[0]5[3][7]467[7]9[9]⑹[6][3]4[9]26[6][2]05[3][1]⑵[5]3[3][3]93153[3]9[1]7[1]0[5]⑶1[3]- = =
[4]3[9]0[9]4[9]25[7]7[7][1]5[6]0[3]-[8]8[2]7[5]37[1][2]6[2]33953[1]96[6][4]4[3]-[3]95-[7]16[4][1]94[0]6[7]7[7][3]96[7]8[-][9]4[1]63[9][8]3[4]9[8]0[7]4[8]08[9]53[8]⑴04[1][8]0[3]9[6]67[6]9[3][4]7[6]⑸[7][2]6[7]⑸6 = =
4[0]2[-][2]9[6]-[6]653[3]93[0]1-[3]2[9]273[4]2[5]⑴[2][3]-[6]⑵[5]8[9][9]25[4]4[9][1]65[2][6]72[8][4]7[7]⑷[0]6[7][3]-[1]6[5]0[5]4[8]6[8]0[1]5↑[-][8]3[3]1[6]-[9]5[2]8[1]6[6]6493[1][1]974[2]61[1][3]94[0][1]4[5]31[2][4]4[1]⑵-[1]53[6]7[6]9[3]3[2][6]⑶[1][4]-
[4]8[3]1[1]55[4][1]46[3][1]⑶[0][3]-[8]⑷[2][6]3[9]28[0]927[7][8]⑷-[1]4[8]⑶[8][9]0[1]4[6]⑺46[3]5[3][5]⑸[4][3]⑼[5]7[6][2]35[4][2]8[1]0[1]-[6]4[7]5
↓[-][1]4[7]-[8]51[8][1]94[0][2]8[7]-[9]89[2][2]37[2][4]45[3][1]⑷-[8]3[2]33[4]1[-]53[3]93[0][9]4[6]7[9]21[9]7[6]2[8]3[2][7]432
/*
萌凤代码生成器 ver.1.3
作者:PoPoQQQ
*/
#include <ctime>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define M 100100
const char table[120][3]={
"","h","he","li","be","b","c","n","o","f","ne","na","mg","al","si","p","s","cl","ar","k","ca","sc","ti","v","cr","mn","fe","co","ni","cu","zn","ga","ge","as","se","br","kr","rb","sr","y","zr","nb","mo","tc","ru","rh","pd","ag","cd","in","sn","sb","te","i","xe","cs","ba","la","ce","pr","nd","pm","sm","eu","gd","tb","dy","ho","er","tm","yb","lu","hf","ta","w","re","os","ir","pt","au","hg","tl","pb","bi","po","at","rn","fr","ra","ac","th","pa","u","np","pu","am","cm","bk","cf","es"
};
int ret[26][26];
const char table2[30][30][10]={
{"[1]1","1[3]","1[8]","[2]0","[3]1","3[3]","4[7]","[5]6","[5]7","[7]3","7[9]","8[5]","[8]8","8[9]","[9]1","9[5]"},
{"4[-]","5-","5[-]","3[5]","[3]7","[4]1","[5]1","5[6]","[6]5","[7]0","[8]2","8[3]","9[7]"},
{"6-","6[-]","1[7]","2[0]","[2]1","2[4]","2[7]","2[9]","[4]3","4[8]","5[5]","5[8]","[8]9","9[6]","9[8]"},
{"[4]6","[4]8","[6]0","[6]4","6[6]"},
{"[2]-","[4]-","[1]0","[2]6","[3]2","[3]4","[5]2","[5]4","[5]8","6[3]","6[8]","[7]5","9[9]"},
{"9-","9[-]","2[6]","[7]2","8[7]","[9]8"},
{"[1]2","3[1]","3[2]","[4]7","6[4]","[8]0"},
{"1-","1[-]","2[-]","[4]5","6[7]","7[2]","8[0]","[9]0"},
{"[3]-","[1]4","[2]2","[2]8","4[9]","53","5[3]","7[7]","[8]3"},
{"↑[-]"},
{"19","1[9]","3[6]","[9]7"},
{"3[-]","[1]3","[1]7","5[7]","7[1]","[8]1"},
{"1[2]","2[5]","4[2]","[6]1","[6]2","[6]9","[9]5","[9]6"},
{"7-","7[-]","1[0]","1[1]","[2]5","2[8]","[3]0","4[1]","[4]9","[5]0","6[0]","[8]6","9[3]"},
{"8-","8[-]","[2]7","[4]2","[6]7","7[6]","[8]4"},
{"15","1[5]","4[6]","5[9]","6[1]","7[8]","8[2]","8[4]","9[1]","[9]3","9[4]"},
{"↓[-]"},
{"[1]8","[2]4","[3]5","[3]6","3[7]","[3]8","[4]0","4[4]","4[5]","[5]9","[6]8","7[5]","[7]7","8[6]","[8]7","8[8]"},
{"1[4]","16","1[6]","2[1]","[3]3","3[4]","3[8]","5[0]","5[1]","[5]5","6[2]","[7]6","[9]9"},
{"2[2]","4[3]","5[2]","6[5]","6[9]","7[3]","[7]8","8[1]","[8]5","9[0]"},
{"[2]9","[4]4","[6]3","[7]1","[7]9","92","9[2]","[9]4"},
{"23","2[3]"},
{"74","7[4]"},
{"5[4]"},
{"39","3[9]","[6]6","7[0]"},
{"3[0]","4[0]"},
{"[1]-","[5]-","[6]-","[7]-","[8]-","[9]-","[1]5","[1]6","[1]9","[2]3","[3]9","[5]3","[7]4","[9]2"}
};
char a[M];
const int top[]={16,13,15,5,13,6,6,8,9,1,4,6,8,13,7,11,1,16,13,10,8,2,2,1,4,2,14};
int main()
{
srand((unsigned)time(NULL));
int i,k;
for(i=1;i<=99;i++)
{
if(table[i][1])
{
ret[table[i][0]-'a'][table[i][1]-'a']=i;
}
}
while(gets(a+1)!=NULL)
{
k=strlen(a+1);
for(i=1;i<=k;i++)
if(a[i]>='A'&&a[i]<='Z')
a[i]=a[i]-'A'+'a';
for(i=1;i<=k;i++)
{
if(a[i]>='a'&&a[i]<='z')
{
if( a[i+1]>='a'&&a[i+1]<='z' && ret[a[i]-'a'][a[i+1]-'a'] )
{
if(rand()%2)
{
printf("%d",ret[a[i]-'a'][a[i+1]-'a']);
if(ret[a[i]-'a'][a[i+1]-'a']<10)
printf("-");
i++;
continue;
}
}
printf("%s",table2[a[i]-'a'][rand()%top[a[i]-'a']]);
}
else
printf("%s",table2[26][rand()%top[26]]);
}
memset(a,0,sizeof a);puts("");
}
return 0;
}
/*
萌凤代码解码器 ver.1.3
作者:PoPoQQQ
*/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define M 100100
const char table[120][3]={
"","h","he","li","be","b","c","n","o","f","ne","na","mg","al","si","p","s","cl","ar","k","ca","sc","ti","v","cr","mn","fe","co","ni","cu","zn","ga","ge","as","se","br","kr","rb","sr","y","zr","nb","mo","tc","ru","rh","pd","ag","cd","in","sn","sb","te","i","xe","cs","ba","la","ce","pr","nd","pm","sm","eu","gd","tb","dy","ho","er","tm","yb","lu","hf","ta","w","re","os","ir","pt","au","hg","tl","pb","bi","po","at","rn","fr","ra","ac","th","pa","u","np","pu","am","cm","bk","cf","es"
};
char a[M*5];
char num[10];
char character[10];
bool mark[10];
int main()
{
int i,k,val;
while(gets(a+1)!=NULL)
{
k=strlen(a+1);
for(i=1;i<=k;)
{
mark[0]=0;mark[1]=0;
if(a[i]==⑼5)
{
if(a[i+1]==⑷)
printf("j");
else
printf("q");
i+=5;
continue;
}
if(a[i]=='[')
{
num[0]=a[i+1];
mark[0]=true;
i+=3;
}
else
{
num[0]=a[i];
mark[0]=false;
i++;
}
if(a[i]=='[')
{
num[1]=a[i+1];
mark[1]=true;
i+=3;
}
else
{
num[1]=a[i];
mark[1]=false;
i++;
}
if(num[1]=='-')
val=(num[0]-'0');
else
val=(num[0]-'0')*10+(num[1]-'0');
character[0]=table[val][0];
character[1]=table[val][1];
if(!mark[0])
putchar(character[0]);
if(!mark[1]&&character[1])
putchar(character[1]);
if(mark[0]&&!character[1])
putchar(' ');
}
memset(a,0,sizeof a);
printf("
");
}
return 0;
}
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠