记录编号 |
85169 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[UVa 11462] 年龄排序 |
最终得分 |
100 |
用户昵称 |
雪狼 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
1.657 s |
提交时间 |
2013-12-28 09:41:04 |
内存使用 |
0.31 MiB |
显示代码纯文本
- #include<iostream>
- #include<cmath>
- #include<cstring>
- #include<cstdio>
- #include<cstdlib>
- #define REP(i,a,b) for(int i=a;i!=b+1;++i)
- #define CLR(c,x) memset(c,x,sizeof(c));
- #define INF ~U0>>2
- #define eps 0.000002
- using namespace std;
-
- typedef long long LL;
- long long num[121];
-
- void setIO(string a){
- string in=a+".in",out=a+".out";
- freopen(in.c_str(),"r",stdin);
- freopen(out.c_str(),"w",stdout);
- }
-
- int buf[10];
- inline void writeInt(int x){
- int p=0;
- if(x==0)p++;
- else while(x){
- buf[p++]=x%10;
- x/=10;
- }
- for(int i=p-1;i>=0;i--)putchar('0'+buf[i]);
- putchar(' ');
- return;
- }
-
- void readInput(){
- CLR(num,0);int t;
- while(~scanf("%d",&t)){
- ++num[t];
- }
- }
-
- void work(){
- REP(i,0,120)REP(j,1,num[i])writeInt(i);
- }
-
- int main(){
- setIO("AgeSort");
- readInput();
- work();
- return 0;
- }
-