PAT-A1038
来源:互联网 发布:看恐怖片的软件 编辑:程序博客网 时间:2024/05/08 06:08
#include <stdio.h>#include<iostream>#include<string>#include<algorithm>using namespace std;bool cmp(string a, string b){return a+b<b+a;}int main(){int i, n;scanf("%d",&n);string ans, a[10010];for(i=0;i<n;i++)cin>>a[i];sort(a,a+n,cmp);for(i=0;i<n;i++)ans=ans+a[i];while(ans.size()>0&&ans[0]=='0')ans.erase(ans.begin());if(ans.size()==0)cout<<"0";//printf("0");else cout<<ans;}
0 0
- PAT A1038
- PAT-A1038
- PAT a1038题解
- pat-a1038. Recover the Smallest Number (30)
- PAT A1038 recover the smallest number (30)
- PAT甲级练习题A1038. Recover the Smallest Number (30)
- 贪心算法--PAT.A1038.Recover the Smallest Number
- PAT A1038 Recover the Smallest Number 算法问题和关于'0'和0的小错误
- A1038. Recover the Smallest Number (30)
- A1038. Recover the Smallest Number (30)
- 刷清橙OJ--A1038.超级重复串
- pat
- 【PAT】
- PAT
- PAT
- PAT
- PAT
- PAT
- PAT-A1036
- Activity-Fragment存储与返回
- PAT-A1037
- dyld: Library not loaded: @rpath/libswiftCore.dylib / Image not found
- Linux 添加/删除用户和用户组
- PAT-A1038
- angular js(2)和ionic(2)的总结
- C# 利用委托实现窗体间传值
- PAT-A1039
- XML中输入特殊符号
- java代码练习
- 操作系统(十三)------死锁的检测与解除
- iOS图片添加平移/缩放/旋转多个手势
- python基础学习_元组拾遗