您的位置:首页 > 运维架构 > Shell

uva 10152 ShellSort

2013-06-04 18:11 239 查看
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
int t;
cin>>t;
char s1[300][100],s2[300][100];
while(t--)
{
int n;
cin>>n;
getchar();
char str[30];
for(int i=0; i<n; i++)
gets(s1[i]);
for(int i=0; i<n; i++)
gets(s2[i]);
int j,i;
for(i=n-1,j=n-1; i>=0; i--)
if(strcmp(s1[i],s2[j])==0)
j--;
for(i=j; i>=0; i--)
puts(s2[i]);
cout<<endl;
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: