Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84711 石依灵 打印每一趟冒泡排序 C++ Compile Error 0 MS 0 KB 331 2024-07-16 11:34:22

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int a[2005],n; cin>>n; for(int i=0;i<n;i++)cin>>a[i]; for(int i=0;i<n-1;i++) { for(int j=0;j<n-1;j++) { if(a[j]>a[j+1]) { int t=a[j]; a[j]=a[j+1]; a[j+1]=t; } } for(int b=0;b<n;b++)cout<<a[b]<<" "; cout<<endl; } ret


Run Info:

Main.cc: In function 'int main()':
Main.cc:22:1: error: 'ret' was not declared in this scope
 ret
 ^
Main.cc:22:1: error: expected '}' at end of input