10361 - Automatic Poetry
来源:互联网 发布:中国联合网络通信股价 编辑:程序博客网 时间:2024/05/20 10:56
一道uva online judge 中的题,出处:uva.onlinejudge.org/index.php
坚持每天进步一点。。。。
#
include < iostream >
#include < cstdio >
#include < cstring >
using namespace std;
const int MIN = 1010;
char str1[MIN];
char str2[MIN];
char str3[MIN];
char str4[MIN];
char str5[MIN];
char str6[MIN];
int main() {
int n, i;
char ch;
cin >> n;
getchar();
for
(i = 0; i < n; i++) {
int flag = 0;
int m = 0;
int count = 1;
while
(ch = getchar()) {
if
((islower((int) ch) || ch ==
' '
) && count == 1)
str1[m++] = ch;
if
(ch ==
'<'
&& count == 1) {
str1[m] =
'/0'
;
count++;
m = 0;
}
if
((islower((int) ch) || ch ==
' '
) && count == 2)
str2[m++] = ch;
if
(ch ==
'>'
&& count == 2) {
str2[m] =
'/0'
;
count++;
m = 0;
}
if
((islower((int) ch) || ch ==
' '
) && count == 3)
str3[m++] = ch;
if
(ch ==
'<'
&& count == 3) {
str3[m] =
'/0'
;
count++;
m = 0;
}
if
((islower((int) ch) || ch ==
' '
) && count == 4)
str4[m++] = ch;
if
(ch ==
'>'
&& count == 4) {
str4[m] =
'/0'
;
count++;
m = 0;
}
if
((islower((int) ch) || ch ==
' '
) && count == 5)
str5[m++] = ch;
if
(ch ==
'/n'
&& count == 5) {
str5[m] =
'/0'
;
count++;
m = 0;
}
if
((islower((int) ch) || ch ==
' '
) && count == 6)
str6[m++] = ch;
if
(ch ==
'.'
) {
str6[m] =
'/0'
;
flag++;
}
if
(flag == 3)
break
;
}
cout << str1 << str2 << str3 << str4 << str5 << endl;
cout << str6 << str4 << str3 << str2 << str5 << endl;
}
return
0;
}
- 10361--Automatic Poetry
- 10361 - Automatic Poetry
- 10361 - Automatic Poetry
- uva 10361 Automatic Poetry
- UVa 10361 - Automatic Poetry
- uva 10361 Automatic Poetry
- 10361 - Automatic Poetry
- UvaOJ 10361 - Automatic Poetry
- UVa 10361 - Automatic Poetry
- UVa 10361 - Automatic Poetry
- uva-10361-Automatic Poetry
- 10361 - Automatic Poetry
- UVA 10361Automatic Poetry
- 10361 - Automatic Poetry
- UVaOJ 10361 - Automatic Poetry
- UVA 10361 - Automatic Poetry
- UVa 10361 - Automatic Poetry
- 10361 - Automatic Poetry
- 嵌入式面试:C和C++汇总试题(1)
- word居然可以这么强大
- 嵌入式笔试面试题:C和C++汇总试题(2)
- ubuntu 解压 打包 命令全集
- 昨天又做梦了!
- 10361 - Automatic Poetry
- 字符串传递给函数模板的引用参数出现出人意料的结果
- 面向对象系统设计
- 感恩
- 忍吧。。忍了这两年。。毕竟我要成功!毕竟我要不同寻常!!
- 英语版的标准程序库
- wangzhijiewz@hotmail.com
- 不管你学的是什么专业,你都应该多少懂些管理学的东西
- dao模式