UVA - 10361 Automatic Poetry
来源:互联网 发布:梦幻西游生死决数据 编辑:程序博客网 时间:2024/05/16 14:08
UVA - 10361 Automatic Poetry
题目大意:给出两个序列,第一个 s1s3s5,第二个 S…。输出两个序列,第一个删除括号,即 s1s2s3s4s5,第二个将 s2 与 s4 交换位置后替换…,即 Ss4s3s2s5。
解题思路:读入两个序列,以括号为分界分别赋值给 5 个字符串,按需求输出。
#include<iostream>#include<cstring>char s[10][10000];int main(){ int cc; scanf("%d",&cc); char temp[10000]; char temp2[10000]; char t[4]="..."; getchar(); while(cc--) { memset(temp,0,sizeof(temp)); memset(temp2,0,sizeof(temp2)); memset(s,0,sizeof(s)); gets(temp); gets(temp2); int i=0; int j=0; for(i ;temp[i] !='<' ;i++) s[0][j++]=temp[i]; i++; j=0; for(i ;temp[i] !='>' ;i++) s[1][j++]=temp[i]; j=0; i++; for(i ;temp[i] !='<' ;i++) s[2][j++]=temp[i]; j=0; i++; for(i ;temp[i] !='>' ;i++) s[3][j++]=temp[i]; j=0; i++; for(i ; i<strlen(temp);i++) s[4][j++]=temp[i]; j=0; for(i = 0; temp2[i]!='.';i++) s[5][j++]=temp2[i]; printf("%s%s%s%s%s\n",s[0],s[1],s[2],s[3],s[4]); printf("%s%s%s%s%s\n",s[5],s[3],s[2],s[1],s[4]); } return 0;}
0 0
- uva 10361 Automatic Poetry
- UVa 10361 - Automatic Poetry
- uva 10361 Automatic Poetry
- UVa 10361 - Automatic Poetry
- UVa 10361 - Automatic Poetry
- uva-10361-Automatic Poetry
- UVA 10361Automatic Poetry
- UVA 10361 - Automatic Poetry
- UVa 10361 - Automatic Poetry
- UVA 10361 Automatic Poetry
- UVa 10361: Automatic Poetry
- UVA 10361 Automatic Poetry
- uva 10361 - Automatic Poetry
- UVa - 10361 - Automatic Poetry
- UVA 10361 Automatic Poetry
- UVa 10361 Automatic Poetry
- uva 10361 Automatic Poetry
- uva 10361 - Automatic Poetry
- JEDEC DDR2和DDR3 SPECIFICATION区别(持续更新)
- UVA-537 Artificial Intelligence?
- php几个比较实用的函数示例
- Quartz和Spring Task定时任务的简单应用和比较
- Suse linux 11 SP3安装VMWare Tools时问题的解决
- UVA - 10361 Automatic Poetry
- HBase 结构设计
- 怎样防止大规模的恶意请求
- 抠像技术介绍
- UVA - 1586 Molar Mass
- spring一些知识点总结,包括spring和hibernate,spring和struts2的整合
- 【JZOJ 4624】字符串匹配
- ACM 常用几何基本数学公式
- Nginx获取自定义头部header的值