← 查看本卷题目
组合题6 个小题
已作答 0 / 6
#include <iostream>#include <string>using namespace std;int a[100];string s;int gen[13] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1};int main() {    cin >> s;    for (int i = 0; i < 32; ++i) {        a[i] = s[i] - '0';    }    for (int i = 32; i < 44; ++i) {        a[i] = 0;    }    for (int i = 0; i < 32; ++i) {        if (a[i] == 0) continue;        for (int j = 0; j < 13; ++j) {            a[i + j] ^= gen[j];        }    }    for (int i = 32; i < 44; ++i) {        cout << a[i];    }    cout << endl;    return 0;}

说明:输入保证为一个长度恰为 32 的 '0' / '1' 字符串。

第 20 题单选题原卷 3 分

该程序实现的功能,最准确的说法是( )。

填写答案