| ||||||||||
| 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 | |||||||||
测试数据正确的话你就不会WA了In Reply To:为什么wa 测试数据正确的呀 大牛们帮帮看看1056 我会被气死了 看一下是哪的问题 Posted by:face1128 at 2007-08-23 16:05:00 > #include<iostream.h>
> #include<string.h>
> int main()
> {
> char a[20];
> int r=0,n=0;
> while(cin>>a)
> {
> char b[20][20];
> if(strcmp(a,"9")!=0)strcpy(b[n++],a);
> else
> {
> int i,j,k,s=0;
> r++;
> for(i=0;i<n-1;i++)
> {
> int c=strlen(b[i]);
> for(j=0;j<n-1;j++)
> {
> if(j!=i)
> {
> for(k=0;k<c;k++)
> {
> if(b[j][k]==b[i][k])continue;
> else break;
> }
> if(k==c)s++;
> }
> }
> }
> if(s==0)cout<<"Set "<<r<<" is immediately decodable"<<endl;
> else cout<<"Set "<<r<<" is not immediately decodable"<<endl;
> n=0;
> }
> }
> return 1;
> }
>
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator