11
作者:互联网
-
#include<bits/stdc++.h> #include <string> using namespace std; struct stu{ char sex; double height; } ;//a[10000],b[10000]; int main() { stu a[1000],b[10000]; int n,c1=0,c2=0; char t; double hg; for(int i=1;i<=n;i++){ cin>>t>>hg; if(1){ a[++c1].sex=t; a[c1].height=hg; } else{ b[++c2].sex=t; b[c2].height=hg; } } sort(a+1,a+c1+1); sort(b+1,b+1+c2); for(int i=1;i<=c1;i++) cout<<a[i].height; for(int i=c2;i>=c1;i--) cout<<b[i].height; }
View Code
标签:11,10000,int,height,c2,c1,hg 来源: https://www.cnblogs.com/orcxiang/p/12165965.html