国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

1038. Recover the Smallest Number (30)

2019-11-14 11:31:27
字體:
來源:轉載
供稿:網友

1038. Recover the Smallest Number (30) 進行排序,注意comp的寫法;

#include <iostream>#include <vector>#include <string>#include <algorithm>using namespace std;bool comp(const string &a,const string &b){ return a+b<b+a;}int main(){ vector<string> v; int n; cin>>n; for(int i=0;i!=n;++i) { string temp; cin>>temp; v.push_back(temp); } sort(v.begin(),v.end(),comp); string ans; for(auto it=v.begin();it!=v.end();++it) ans+=*it; auto it=ans.begin(); while(it!=ans.end()&&(*it)=='0')++it; if(it==ans.end())cout<<0; else while(it!=ans.end()) { cout<<*it;++it; } return 0;}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 新建县| 祁连县| 罗山县| 拉萨市| 米易县| 邵东县| 桐柏县| 大宁县| 丹江口市| 广平县| 门头沟区| 北宁市| 苏尼特右旗| 安顺市| 绵阳市| 西青区| 西林县| 浦江县| 同心县| 福鼎市| 时尚| 肇源县| 邓州市| 建始县| 永兴县| 杭锦旗| 合山市| 偃师市| 东阿县| 绥化市| 旅游| 美姑县| 济宁市| 婺源县| 新竹县| 新蔡县| 天长市| 张家口市| 张家口市| 沙河市| 丹巴县|