!!!!ans

LS_shijianrui 2023-12-09 21:03:07 3 返回题目

#include <bits/stdc++.h> using namespace std; int n,a[10000000]; double b[10000000]; string c[10000000]; int main() { cin>>n; for(int i=1; i<=n; i++) cin>>a[i]>>b[i]>>c[i]; for(int i=1; i<=n-1; i++) { for(int j=i+1; j<=n; j++) { if(a[j]<a[i]) swap(a[i],a[j]),swap(b[i],b[j]),swap(c[i],c[j]); } } for(int i=1; i<=n; i++) { cout<<a[i]<<" "; cout<<fixed<<setprecision(2)<<b[i]<<" "; cout<<c[i]<<endl; } return 0; }

{{ vote && vote.total.up }}