| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 86798 | 梁敖铭 | 两个数的最小距离 | C++ | Compile Error | 0 MS | 0 KB | 449 | 2024-07-28 10:34:41 |
#include <iostream> using namespace std; int main() { int a[1005]; int n; intt; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } int min = abs (a[1] - a[2]); for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { t = abs(a[i] - a[j]); if (t < min) { min = t; } } } cout << min; return 0; }
Main.cc: In function 'int main()':
Main.cc:6:1: error: 'intt' was not declared in this scope
intt;
^
Main.cc:14:13: error: 't' was not declared in this scope
t = abs(a[i] - a[j]);
^