【题目链接】:
【题意】
【题解】
把密文; 在表中找到每个字符对应的数字; 然后转换成相应的二进制; 如果不足6位就在二进制的前面补零补到6位; 然后每个字符6个二进制6个二进制地排在一起; 然后8位8位地输出; ->最后可以得到”要你输入一个整数x,然后输出x%2017”; 【Number Of WA】 0 【完整代码】#includeusing namespace std;#define rep1(i,x,y) for (int i = x;i <= y;i++)#define LL long longmap dic;string s,temp;int a[20],tot,x;string cl(int x){ string d = ""; while (x) { d=char((x&1)+'0')+d; x>>=1; } while (int(d.size())<6) d='0'+d; return d;}char out(){ int d = 0; for (int now = 1,i = 8;i>=1;i--) { d+=a[i]*now; now<<=1; } char t = d; return t;}int main(){ //freopen("D:\\rush.txt","r",stdin); for (char key = 'A';key<='Z';key++) dic[key]=key-'A'; for (char key = 'a';key<='z';key++) dic[key]=key-'a'+26; for (char key = '0';key<='9';key++) dic[key]=key-'0'+52; dic['+']=62,dic['/']=63; //cin >> s; s="d2hhdCBpcyB0aGUgcmVtYWluZGVyIHdoZW4gdGhlIG51bWJlciBpcyBkaXZpZGVkIGJ5IDIwMTc/"; temp=""; int len = s.size(); rep1(i,0,len-1) { temp+=cl(dic[s[i]]); } len = temp.size(); //cout << temp< “what is the reminder of x after divided by 2017" */ int T; cin >> T; while (T--) { cin >> x; cout << x%2017<