uva10361--String
2011-12-08 21:10
246 查看
字符串类型的水题
//#define LOCAL #include <stdio.h> #include <string.h> #define MAXN 100 + 10 char s1[MAXN], s2[MAXN], s3[MAXN], s4[MAXN], s5[MAXN]; char buf[MAXN]; int main() { #ifdef LOCAL freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); #endif int cases; char c; int i, j; scanf("%d", &cases); c = getchar();// 消除数字后面的回车 while(cases--) { // 数据初始化 memset(s1, 0, sizeof(s1)); memset(s2, 0, sizeof(s2)); memset(s3, 0, sizeof(s3)); memset(s4, 0, sizeof(s4)); memset(s5, 0, sizeof(s5)); memset(buf, 0, sizeof(buf)); // 数据输入 // 输入s1 c = getchar(); for(i = 0;c != '<';i++) { s1[i] = c; c = getchar(); } // 输入s2 c = getchar(); for(i = 0;c != '>';i++) { s2[i] = c; c = getchar(); } // 输入s3 c = getchar(); for(i = 0;c != '<';i++) { s3[i] = c; c = getchar(); } // 输入s4 c = getchar(); for(i = 0; c != '>';i++) { s4[i] = c; c = getchar(); } // 输入s5 c = getchar(); for(i = 0; c != '\n';i++) { s5[i] = c; c = getchar(); } // 输入buf c = getchar(); for(i = 0; c != '.';i++) { buf[i] = c; c = getchar(); } c = getchar(); c = getchar(); c = getchar(); // 消除两个点和一个换行 // 数据输出 printf("%s%s%s%s%s\n", s1, s2, s3, s4, s5); printf("%s%s%s%s%s\n", buf, s4, s3, s2, s5); } return 0; }
相关文章推荐
- Volume 1. Elementary Problem Solving :: String Uva 401,10010,10361,537,409
- UVA - 1368 DNA Consensus String
- uva 10361
- UVa-10361-Automatic Poetry
- UVA 10361 Automatic Poetry
- uva 1368 - DNA Consensus String(贪心)
- 【UVA】10739 - String to Palindrome(动态规划)
- 详细解答Uva - 1368 - DNA Consensus String
- UVA - 10739 String to Palindrome
- uva 10739 String to Palindrome
- 【Uva 1368】 DNA Consensus String
- uva 10739 String to Palindrome(dp)
- UVa10361_Automatic Poetry(小白书字符串专题)
- UVA 10361 - Automatic Poetry
- uva 10361 Automatic Poetry
- uva 10361 - Automatic Poetry
- UVaLive 6832 Bit String Reordering (模拟)
- uva 10361 - Automatic Poetry
- UVa 1368 - DNA Consensus String
- UVa 10739. String to Palindrome