uva_10361-Automatic Poetry
[cpp]
/**本题看懂题意就好解决了,就是把括号去掉输出一次,
*然后交换字符串再输出一次
*/
#include <cstdio>
#include <cstring>
#define MAXS 6
#define MAX 101
int main(int argc, char const *argv[])
{
char c,s[MAXS][MAX];
int n,i,j,l;
scanf("%d",&n);
getchar();
for(i=0;i<n;i++)
{
j=1;l=0;
memset(s,'\0',sizeof(s));
while((c=getchar())!='\n')
{
if(c=='<' || c=='>'){j++;l=0;continue;}
s[j][l++]=c;
}
gets(s[0]);
for(int i=0; i<3; i++)
s[0][strlen(s[0])-1]='\0';
printf("%s%s%s%s%s\n",s[1],s[2],s[3],s[4],s[5]);
printf("%s%s%s%s%s\n",s[0],s[4],s[3],s[2],s[5]);
}
return 0;
}
补充:软件开发 , C++ ,