Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## 这样就OK了

Posted by czcomt at 2008-12-25 15:14:38 on Problem 2629
In Reply To:Re:我的代码为什么会PE呀，高手帮帮忙 Posted by:caiqunhao at 2008-08-25 15:47:27
```#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
using namespace std;
int main()
{
int a[123],b[123],i,flag;
char c;
int num;
while(1)
{
flag=0;
for(i=97;i<123;++i)
{
a[i]=0;
b[i]=0;
}
++a[c];
while(1)
{
c=getchar();
if(c=='\n')
break;

if (c == EOF)
{
return 0;
}

++a[c];
}
while(1)
{
c=getchar();
if(c=='\n')
break;
++b[c];
}
for(i=97;i<123;++i)
{
num=a[i]>b[i]?b[i]:a[i];
while(num--)
{
printf("%c",i);
}
}
printf("\n");
}
return 0;
}

```

Followed by: