编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#22047 | #1119. Rhodoks的2-sum问题 | Compile Error | 0 | 0 ms | 0 K | C++ / 354 B | 月子 | 2020-02-11 18:51:08 |
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int n, k, a[500006], c;
int main() {
cin >> n >> k;
c = 1;
int i, j;
for (i = 1; i <= n; i++) {
scanf("%d", &a[i]);
}
for (i = 1; i < n; i++) {
for (j = i + 1; j <= n; j++) {
if (a[i] + a[j] == k) {
c = 0;
break;
}
}
if (c == 0)
break;
}
if (c == 0)
cout << "Yes";
else
cout << "No";
}
编译信息
/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:13:3: error: 'scanf' was not declared in this scope
scanf("%d",&a[i]);
^~~~~
/sandbox/1/a.cpp:13:3: note: suggested alternative: 'wscanf'
scanf("%d",&a[i]);
^~~~~
wscanf