编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#90 #1001. A. 神秘谜题 Compile Error 0 0 ms 0 K C++ / 417 B 机类824王琨 2019-06-06 1:24:18
显示原始代码
#include <iostream>
using namespace std;
int main() {
    int n, i, k = 0, j, m = 0;
    cin >> n;
    int *a = new int[n];
    int *b = new int[n];
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
        if (a[i] == 2) {
            cin >> b[k];
            m = m ^ b[k];
            k++;
            cout << m << endl;
        } else {
            m = 0;
            for (j = 0; j < k; j++) {
                b[j] = b[j] + 1;
                m = m ^ b[j];
            }
            cout << m << endl;
        }
    }
    delete[] a;
    delete[] b;
    return 0;
}

编译信息

/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:11:3: error: 'scanf' was not declared in this scope
   scanf("%d",&a[i]);
   ^~~~~
/sandbox/1/a.cpp:11:3: note: suggested alternative: 'wscanf'
   scanf("%d",&a[i]);
   ^~~~~
   wscanf