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 |
这样就OK了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: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator