Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84571 刘泽熙 初级冒泡排序 C++ Compile Error 0 MS 0 KB 271 2024-07-16 10:59:33

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int a[1000]; int main(){ int n; cin>>n; for(int k=1;k<n;k++){ cin>>n[k]; } for(int i=0;i<n;i++){ for(int j=0;j<10-i-1;j++){ if(a[j<a[j+1]]){ t=a[j]; a[j]a[j-1]; a[j+1]=t; } } } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:11: error: invalid types 'int[int]' for array subscript
   cin>>n[k];
           ^
Main.cc:13:5: error: 't' was not declared in this scope
     t=a[j];
     ^
Main.cc:14:9: error: expected ';' before 'a'
     a[j]a[j-1];
         ^
Main.cc:14:8: warning: statement has no effect [-Wunused-value]
     a[j]a[j-1];
        ^