Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106701 张永良 打印每一趟选择排序 C++ Compile Error 0 MS 0 KB 970 2025-01-16 15:12:22

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int arr[2000]; int main(){ int n; cin >> n; for(int i = 0;i < n;i++){ cin >> arr[i]; } int min,k,t; for(int i = 0;i < n - 1;i++){ min = arr[i]; #include<bits/stdc++.h> using namespace std; int arr[2000]; int main(){ int n; cin >> n; for(int i = 0;i < n;i++){ cin >> arr[i]; } int min,k,t; for(int i = 0;i < n - 1;i++){ min = arr[i]; k = i; for(int j = i + 1;j < n;j++){ if(min > arr[j]){ min = arr[j]; k = j; } } t = arr[i]; arr[i] = arr[k]; arr[k] = t; for(int i = 0;i < n;i++){ cout << arr[i] << " "; } cout <<endl; } return 0; } k = i; for(int j = i + 1;j < n;j++){ if(min > arr[j]){ min = arr[j]; k = j; } } t = arr[i]; arr[i] = arr[k]; arr[k] = t; for(int i = 0;i < n;i++){ cout << arr[i] << " "; } cout <<endl; } return 0; }


Run Info:

Main.cc:12:15: error: stray '#' in program
 min = arr[i]; #include  
               ^
Main.cc: In function 'int main()':
Main.cc:12:16: error: 'include' was not declared in this scope
 min = arr[i]; #include  
                ^
Main.cc:12:24: error: 'bits' was not declared in this scope
 min = arr[i]; #include  
                        ^
Main.cc:12:29: error: 'stdc' was not declared in this scope
 min = arr[i]; #include  
                             ^
Main.cc:13:1: error: expected primary-expression before 'using'
 using namespace std;  
 ^
Main.cc:15:11: error: a function-definition is not allowed here before '{' token
 int main(){  
           ^
Main.cc:59:1: error: expected '}' at end of input
 }
 ^
Main.cc:14:5: warning: unused variable 'arr' [-Wunused-variable]
 int arr[2000];  
     ^
Main.cc:10:9: warning: unused variable 'k' [-Wunused-variable]
 int min,k,t;  
         ^
Main.cc:10:11: warning: unused variable 't' [-Wunused-variable]
 int min,k,t;  
           ^
Main.cc:59:1: error: expected '}' at end of input
 }
 ^