Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140897 李折曦 19斯诺克比赛 C++ Compile Error 0 MS 0 KB 353 2025-12-20 14:27:02

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n; int a[1001]; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int j=1;j<n;i++){ for(int i = 1;i<n;i++){ if(int a[i]>a[i]+1){ int temp=a[i]; a[i]=a[i+1]; a[i+1]=temp; } } } } for(int i = 1;i<+n;i++){ cout<<a[i]<<" "; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:18: error: 'i' was not declared in this scope
  for(int j=1;ja[i]+1){
      ^
Main.cc:12:6: error: expected ')' before 'int'
Main.cc: At global scope:
Main.cc:20:2: error: expected unqualified-id before 'for'
  for(int i = 1;i<+n;i++){
  ^
Main.cc:20:16: error: 'i' does not name a type
  for(int i = 1;i<+n;i++){
                ^
Main.cc:20:21: error: 'i' does not name a type
  for(int i = 1;i<+n;i++){
                     ^
Main.cc:23:2: error: expected unqualified-id before 'return'
  return 0;
  ^
Main.cc:24:1: error: expected declaration before '}' token
 }
 ^