problem solve in c?
You know Galois is a very smart student. He dislikes History exams and you know that he will find a smart way to cheat. You are the supervisor in the exam hall for his History exam and you recover from him a sheet of paper that contains several lines that appear to be in a language not even remotely resembling English even though the alphabets used are from the English language. The Principal will not believe you unless you establish beyond doubt, that the paper recovered from him contains an answer to one of the questions. You show the paper to the head of Computer Science department and he says that it is a well-known crypto method and agrees to decrypt the same for you. It turns out that Galois did the following,
He writes the original message in a zig zag pattern and reads of the lines horizontally. For example, IAMSMARTERTHANYOU is written first as and encoded as IEUATROMRTYSAHNMA
Given the number of rows used by Galois to encode the text and the encoded text, write a program to recover the original text. Note that if the length of the string is not adequate to complete the pattern, Galois pads it with the character "X" to make up the length. These must not appear in the output.
Input Format:
The first line of the input is the number of rows (depth) Galois used in his coding scheme
The next line is the encoded message
Output Format:
The decoded message with all the padding characters (if any) removed.
Constraints:
Depth ≤10
Example 1
Input
5
CCEAEOSNDDEYUEHOT
Output
CANYOUDECODETHESE
Explanation
The depth is 5. When the input message is laid out, it looks like this
Hence the output is CANYOUDECODETHESE
deepan44:
Answer for this code
Answers
Answered by
0
I specifically avoided a discussion of the question of student ethics and character in my article, not because I wanted to exonerate students from their share of the blame, but because I hoped to focus on pedagogy’s role in academic dishonesty. But just when I thought I had succeeded in divorcing character from practice for the sake of discussion, the folly of my strategy was made shockingly clear.
Similar questions