哪位大犇能救救蒟蒻,QWQ

P1116 车厢重组

AC码 ``` #include <bits/stdc++.h> using namespace std; int main() { freopen("21310.in","r",stdin); freopen("21310.out","w",stdout); long a[10000],b,c=0; cin>>b; for(int i=1;i<=b;i++) { cin>>a[i]; } for(int i=1;i<=b-1;i++) { for(int j=1;j<=b-i;j++) { if(a[j]>a[j+1]) { swap(a[j],a[j+1]);c++; } } } cout<<c; fclose(stdin); fclose(stdout); return 0; } ```
by lorry26 @ 2023-07-04 16:52:07


@[lorry26](/user/931262) 谢谢大犇!!!
by 23_VS_24 @ 2023-07-05 08:56:58


|