The Grille
题目链接:
http://acm.hust.edu.cn/vjudge/problem/26634
Description
http://7xjob4.com1.z0.glb.clouddn.com/a7d33cb3303ea18c9e6f3de676f242a6Input
The input contains several test cases. Each test case contains description of a grille and a ciphertext. Your task is to decipher the message and write the plaintext to output. Each test case starts with a line containing number N (1 ≤ N ≤ 1000), where N is the size of the grille. Then there are N lines containing the grille description. Each of those lines contains exactly N characters which are either the “hash” character ‘#’ (solid/opaque material) or the uppercase letter ‘O’ (hole). Note: In praxis, the grille holes would be arranged in such a way that no position of the ciphertext is used more than once. In our problem, this is not guaranteed. Some grilles may contain holes that match the same position/letter of the ciphertext (after rotations). However, the deciphering algorithm is still the same. After the grille description, there are another N lines with the enciphered message. Each of them contains exactly N characters - uppercase letters of alphabet. The last test case is followed by a line containing one zero.Output
For each test case, output the deciphered message (plaintext) on one line with no spaces.Sample Input
``` 4 ##O# #O#O #### ###O ARAO PCEM LEEN TURC 3 O#O ### O#O ABC DEF GHI 0 ```Sample Output
ACMCENTRALEUROPE ACGIACGIACGIACGISource
2016-HUST-线下组队赛-1##题意: 加密过程:每次在空白位置写一个字符,写完后正旋90°再写,重复四次. 求解密后的字符串.
##题解: 瞎转一通就好了.
##代码: ``` cpp #include