您的位置:首页 > 其它

uva 10361 Automatic Poetry

2013-06-16 17:28 323 查看
题目:10361 - Automatic Poetry

思路:水题。。暴力

#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
char str[110];
string s[6];
int main()
{
int t;
scanf("%d",&t);
getchar();
while(t--)
{
gets(str);
for(int i=0;i<=5;i++)
s[i]="";
int l=strlen(str);
int i=0;
while(str[i]!='<')
{
s[0]+=str[i];
i++;
}
i++;
while(str[i]!='>')
{
s[1]+=str[i];
i++;
}
i++;
while(str[i]!='<')
{
s[2]+=str[i];
i++;
}
i++;
while(str[i]!='>')
{
s[3]+=str[i];
i++;
}
i++;
while(i<l)
{
s[4]+=str[i];
i++;
}
gets(str);
i=0;
while(1)
{
if(str[i]=='.'&&str[i+1]=='.'&&str[i+2]=='.')
break;
s[5]+=str[i];
i++;
}
for(int i=0;i<=4;i++)
cout<<s[i];
cout<<endl;
swap(s[1],s[3]);
cout<<s[5];
for(int i=1;i<=4;i++)
cout<<s[i];
cout<<endl;
}
return 0;
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: