问题:
解密下面一段编码:
MDExMTAxMTEwMTEwMDEwMTAxMTAxMTAwMDExMDAwMTEwMTEw MTExMTAxMTAxMTAxMDExMDAxMDEwMTAxMTExMTAxMTEwMTAwM DExMDExMTEwMTAxMTExMQ==
Solve:
1.http://tool.oschina.net/encrypt?type=3
2.Base64转换后得到01串:
0111011101100101011011000110001101101111011011 010110010101011111011101000110111101011111
然后将01串转为字符(8位01转成一位字符)
3.code
#include<iostream>
#include<string.h>
using namespace std;
int main(){
char s[1000];
cin>>s;
//cout<<strlen(s);
for(int i = 0;i < strlen(s); i+=8){
char ch=0;
for(int j = 0;j <8; j++){
ch<<=1;
ch|=s[i+j]-'0';
}
cout<<ch;
}
return 0;
}
最后得到结果:welcome_to_