| ||||||||||
| 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 | |||||||||
Re:为什么一直是output limited exceed啊!那为高手帮忙看看,谢谢了!In Reply To:为什么一直是output limited exceed啊!那为高手帮忙看看,谢谢了! Posted by:lianxi at 2005-04-22 19:27:19 Source
Problem Id:1056 User Id:mccxj
Memory:196K Time:0MS
Language:G++ Result:Accepted
Source
#include <iostream.h>
#include <string.h>
int set=1;
char get[10][15];
int i,j,k;
int count=1;
void fun()
{
for(i=0;i<count-1;i++)
{
for (j=i+1;j<count;j++)
{
for(k=0;get[i][k]!='\0'&&get[j][k]!='\0';k++)
{
if (get[i][k]!=get[j][k]) break;
}
if (get[i][k]=='\0'||get[j][k]=='\0')
{
cout<<"Set "<<set++<<" is not immediately decodable"<<endl;
count=1;
return;
}
}
}
cout<<"Set "<<set++<<" is immediately decodable"<<endl;
count=1;
return;
}
int main()
{
while (cin>>get[0])
{
for(i=1;;i++)
{
cin>>get[i];
if (strcmp(get[i],"9")==0) break;
count++;
}
// cout<<count<<endl;
fun();
}
return 0;
}
懒得自己打。。copy了你的。改了。。ac
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator