Children's Game UVA
来源:互联网 发布:淘宝店铺钻石等级 编辑:程序博客网 时间:2024/06/08 16:56
转自。。http://www.cnblogs.com/scau20110726/archive/2013/04/23/3039236.html
我没有想到用string或者char* 自带的比较函数,,还打算自己比较。。
感觉这种想法很好。。
还有一个收获就是另一种写法中的;
对于循环的处理。。可以用(j+1)%lenj;
还有各种lcm gcd 的复习。。
#include<bits/stdc++.h>using namespace std;#define mem(a,b) memset(a,b,sizeof(a));#define sf scanf#define pf printf#define bug1 printf("bug1\n");#define N 35#define M 55#define LL long longstring num[M];bool cmp(string a,string b){ return a+b>b+a;}int main(){ int n; while(~sf("%d",&n)&&n){ for(int i=1;i<=n;++i) cin>>num[i]; sort(num+1,num+1+n,cmp); for(int i=1;i<=n;++i) cout<<num[i]; pf("\n"); }}
0 0
- uva Children's Game
- Uva Children's Game
- Children's Game UVA
- Children's Game UVA
- Children's Game UVA
- Children's Game UVA
- UVa 10905 - Children's Game
- UVa 10905 - Children's Game
- uva 10905 - Children's Game
- uva 10905 - Children's Game
- UVA 10905 Children's Game
- UVa 10905 - Children's Game
- Uva-10905-Children’s Game
- UVa 10905 - Children's Game
- UVa 10905 - Children's Game
- uva 10905 - Children's Game
- UVa 10905 - Children's Game
- uva 10905-Children’s Game
- 正则表达式入门
- Unity实现物体逐渐消失
- VS2013编译Live555
- 使用eclipse搭建c/c++开发环境的详解步骤
- Can't start Git: git.exe
- Children's Game UVA
- nginx 的配置特殊用法(rewrite规则)
- Golang实现文字转字符画
- DevOps发展的9个趋势
- 一句话概括下spring框架及spring cloud框架主要组件
- sql 查询字段结果中显示单引号
- 设计模式之工厂模式
- Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.tran
- mysql同一个表按当前时间分段分开排序