ZOJ 3121 Arne Saknussemm
2013-05-30 10:55
176 查看
字符串解密水题.
最后一列注意一下就可以.
最后一列注意一下就可以.
#include <iostream> #include <cstdio> #include <string.h> #include <memory.h> using namespace std; const int maxn = 1010; char str[maxn]; int n; int main(){ while(~scanf("%d", &n)){ scanf("%s",str); int k = strlen(str); for(int i = 1; i < n; ++i){ scanf("%s", &str[i * k]); } int row = strlen(str) / k; for(int i = k - 1; i >= 0; --i){ int tmp = 0; if(i == 0){ for(; tmp < k && str[tmp] == '_'; ++tmp); } for(int j = n - 1; j >= tmp; --j){ char & ch = str[j * k + i]; if(ch == '_'){ printf(" "); }else if(ch == '\\'){ printf("\n"); }else{ printf("%c", ch); } } } printf("\n\n"); } return 0; }
相关文章推荐
- ZOJ 3121 Arne Saknussemm
- zoj 3121 Arne Saknussemm
- ZOJ 3121 Arne Saknussemm
- zoj 3121
- ZOJ-3121
- ZOJ 1586 QS Network
- Magic Number - ZOJ 3622 水题
- zoj 3494 BCD Code (ac自动机+数位dp)
- D - Beauty of Array ZOJ - 3872
- ZOJ 2580 Sudoku (DFS)
- zoj Circle 并查集+出入度检测
- ZOJ 3875 Lunch Time
- 浙江省赛2015 _ J - Convert QWERTY to Dvorak -> ZOJ 3878
- zoj 2859 Matrix Searching
- zoj 2562 More Divisors
- zoj 3329(经典概率dp)
- ZOJ - 4006(数论逆元)
- ZOJ 3665
- ZOJ-1184
- ZOJ 2562 More Divisors (n以内约数个数最多的最小数)