Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## 好心人帮我看一下~为什么会WA

Posted by dodo_nudt at 2005-09-29 02:33:42 on Problem 1053
```#include <iostream>
#include <string>
using namespace std;
int n,i,j,k;
string card[12];
char count[3]={'1','2','3'};
char symbol[3]={'D','O','S'};
char color[3]={'R','G','P'};
int main ()
{
while (cin>>card[0])
{
for (i=1;i<12;i++)
cin>>card[i];
cout<<"CARDS:  ";
for (i=0;i<12;i++)
cout<<card[i]<<" ";
cout<<endl;
cout<<"SETS:   ";
int flagset=0;//set exist//
n=1;
for (i=0;i<10;i++)
for (j=i+1;j<11;j++)
{
string temp;
if(card[i][0]==card[j][0])
temp+=card[i][0];
else
{
for (k=0;k<3;k++)
if (symbol[k]!=card[i][0]&&symbol[k]!=card[j][0])
break;
temp+=symbol[k];
}
if (card[i][1]==card[j][1])
temp+=card[i][1];
else
{
for (k=0;k<3;k++)
if (count[k]!=card[i][1]&&count[k]!=card[j][1])
break;
temp+=count[k];
}
if (card[i][2]==card[j][2])
temp+=card[i][2];
else
{
for (k=0;k<3;k++)
if (color[k]!=card[i][2]&&color[k]!=card[j][2])
break;
temp+=color[k];
}
if (card[i][3]==card[j][3])
temp+=card[i][3];
else
{
for (k=0;k<3;k++)
break;
}
for (k=j+1;k<12;k++)
if (temp==card[k])
{
flagset=1;
cout<<n++<<".  "<<card[i]<<" "<<card[j]<<" "<<temp<<endl;
cout<<"        ";
}
}
if (!flagset)
cout<<"*** None Found ***"<<endl;
}
return 0;
}
```

Followed by: