| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 69073 | 周奕辰 | 优化冒泡排序 | C++ | Runtime Error | 0 MS | 268 KB | 527 | 2024-03-30 14:35:33 |
#include<iostream> using namespace std; int main (){ int a[55]; int t ,n; bool k; cin >> n; for(int i=1;i<=n;i++) cin >> a[i]; for(int i=0;i<n-1;i++) { k=false; for(int j=0;j<n-1;j++) { if(a[j]<a[j+1]) { t=a[j]; a[j]=a[j+1]; a[j+1]=t; k=true; } } if(k=false) break; } for(int i=0;i<n ;i++) cout <<a[i] << " "; return 0; }
*** stack smashing detected ***: ./Main terminated