Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我的代码为什么会PE呀,高手帮帮忙#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((c=getchar())!=EOF) { flag=0; for(i=97;i<123;++i) { a[i]=0; b[i]=0; } ++a[c]; while(1) { c=getchar(); if(c=='\n') break; ++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"); } system("pause"); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator