UVA 10361 (暑假-字符串(1) -C - Automatic Poetry)
来源:互联网 发布:悠悠乎乎的意思 编辑:程序博客网 时间:2024/04/29 23:16
#include <cstdio>#include <cstring>int main() {int t;scanf("%d", &t);getchar();while (t--) {char s1[200], s2[200];gets(s1);gets(s2);int len = strlen(s1);for (int i = 0; i < len; i++) {if (s1[i] != '<' && s1[i] != '>')printf("%c",s1[i]);}printf("\n");int kong = 0;for (int i = 0; s2[i] != '.'; i++)printf("%c", s2[i]);for (int i = 0; i < 3; i++)for (int j = 0; j < len; j++) {int k;if (s1[j] == '<' || s1[j] == '>')kong++;if (kong == 3) {for (k = j + 1; s1[k] != '>'; k++)printf("%c", s1[k]);j = k-1;}if (kong == 6) {for (k = j + 1; s1[k] != '<'; k++)printf("%c", s1[k]);j = k -1;}if (kong == 9) {for (k = j + 1; s1[k] != '>'; k++)printf("%c", s1[k]);j = k - 1;}if (kong == 12) {for (k = j + 1; k < len; k++)printf("%c", s1[k]);j = k - 1;}}printf("\n");}return 0;}
0 0
- UVA 10361 (暑假-字符串(1) -C - Automatic Poetry)
- UVA 10361 - Automatic Poetry(字符串)
- uva 10361 Automatic Poetry(字符串处理)
- uva 10361 - Automatic Poetry (简单字符串)
- Automatic Poetry - UVa 10361 简单字符串处理
- 字符串训练 ----------- uva 10361 Automatic Poetry
- 字符串C - 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 10361Automatic Poetry
- UVA 10361 - Automatic Poetry
- UVa 10361 - Automatic Poetry
- UVA 10361 Automatic Poetry
- UVa 10361: Automatic Poetry
- MSP430--Timer A
- POJ3525-Most Distant Point from the Sea
- 找到自己的毛病,并找到适合自己的解决方法
- poj 1699 Best Sequence
- 集合变数组
- UVA 10361 (暑假-字符串(1) -C - Automatic Poetry)
- Java语言基础(类型运算细节)
- 银行从业资格 公共基础 视频笔记
- 去掉用fgets()读入的字符串中的换行符
- hdu 1452
- vmware workstation10安装win7 ghost教程
- 关于mysql 索引实现 (转贴)
- poj-1988 Cube Stacking 带权并查集
- 插头与轮廓线与基于连通性状态压缩的dp 学习指南