题目(材料题)
01 #include <iostream>
02 #include <cstring>
03 using namespace std;
04 int a[100];
05 string s;
06 int gen[13] = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 };
07 int main() {
08 cin >> s;
09 for (int i = 0; i < 32; ++i) {
10 a[i] = s[i] - '0';
11 }
12 for (int i = 32; i < 44; ++i) {
13 a[i] = 0;
14 }
15 for (int i = 0; i < 32; ++i) {
16 if (a[i] == 0) continue;
17 for (int j = 0; j < 13; ++j) {
18 a[i + j] ^= gen[j];
19 }
20 }
21 for (int i = 32; i < 44; ++i) {
22 cout << a[i];
23 }
24 cout << endl;
25 return 0;
26 }
输入保证为一个长度恰为32的'0/1'字符串。
||

关注我们