记录详情

Compile Error

/in/foo.cc:1:21: warning: extra tokens at end of #include directive
 #include <iostream> using namespace std; void Insert(int arr[], int& n, int x) { int i; for (i = n - 1; i >= 0 && arr[i] > x; i--) { arr[i + 1] = arr[i]; } arr[i + 1] = x; n++; } int main() { int n; cin >> n; int arr[n + 1]; for (int i = 0; i < n; i++) { cin >> arr[i]; } int x; cin >> x; Insert(arr, n, x); for (int i = 0; i < n; i++) { cout << arr[i] << " "; } cout << arr[n - 1]; return 0; }
                     ^~~~~
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

信息

递交者
类型
递交
比赛
泰院2405作业赛第二场
语言
C++
递交时间
2024-10-28 21:37:24
评测时间
2024-10-28 21:37:24
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes