| ||||||||||
| 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 | |||||||||
why WA,is there any test cases???#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int nCases,i,j;
char target[101],str1[101],str2[101];
cin >> nCases;
while(nCases--){
cin >> target >> str1 >> str2;
int currentJ = 0;
bool win = false;
for(i = 0;i < strlen(target);) {
if(currentJ == strlen(str1))
break;
i++;
for(j = currentJ;j < strlen(str1);j++)
if(str1[j] == target[i] || str2[j] == target[i] || str1[j] == '*'){
currentJ = j + 1;
break;
}
else
currentJ++;
}
if(i == strlen(target))
win = true;
if(win == true)
cout << "win" <<endl;
else
cout << "lose" <<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator