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> using namespace std; int main() { char p[80],xx[40][2]; int i,j,len,t,k,s; while(1) { gets(p); if(p[0]=='*') break; len=strlen(p); for(i=1;i<len;i++) { t=1; k=0; for(j=0;j+i<len;j++) { xx[k][0]=p[j]; xx[k][1]=p[j+i]; k++; } for(j=0;j<k-1;j++) { for(s=j+1;s<k;s++) { if(xx[j][0]==xx[s][0]&&xx[j][1]==xx[s][1]) { t=0; break; } } if(!t) break; } if(!t) break; } if(t) printf("%s is surprising.\n",p); else printf("%s is NOT surprising.\n",p); } return 1; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator