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 |
为什么会超时呢?帮我看一下,谢了。(附代码)#include <iostream> #include<memory.h> using namespace std; int main() { int map[256]={0}; char a,b; map['B'] = map['F'] = map['P'] = map['V'] = 1; map['C'] = map['G'] = map['J'] = map['K']= map['Q'] = map['S'] = map['X'] = map['Z'] = 2; map['D'] = map['T'] = 3; map['L'] = 4; map['M'] = map['N'] = 5; map['R'] = 6; while(a=getchar()) { if(map[a]==map[b]) { } else if((a!='\n')&&(map[a]!=0)) { printf("%d",map[a]); } else if(a=='\n') { printf("\n"); } b=a; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator