杭电acm 1022 为什么提交没通过,是高手的进来看看!!
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
char o1[10],o2[10];
char s[10],stack[10];
int n;
while(cin>>n)
{
cin>>o1>>o2;
int i=0,j=0,k=-1,m=0;
while(1)
{
k++;
stack[k]=o1[i];
i++;s[m]='i';m++;
while(stack[k]==o2[j])
{
s[m]='o';
m++;k--;
j++;
}
if(i==strlen(o1))
break;
}
if(k<0)
{
cout<<"Yes."<<endl;
for(int e=0;e<m-1;e++)
{
if(s[e]=='i')
cout<<"in"<<endl;
else
cout<<"out"<<endl;
}
}
else
cout<<"No."<<endl;
cout<<"FINISH"<<endl;
}
return 0;
}