Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char dec[210][25];
- char mess[210];
- int n;
- int main() {
- while (1) {
- scanf("%d", &n);
- if (!n) break;
- scanf(" %s", mess);
- int line=0; int cnt=0;
- for (int j=0; mess[j]!='\0'; j++) {
- if (line%2) dec[line][n-j%n-1]=mess[j];
- else dec[line][j%n]=mess[j];
- cnt++;
- if (cnt==n) cnt=0, line++;
- }
- for (int j=0; j<n; j++)
- for (int i=0; i<line; i++)
- printf("%c", dec[i][j]);
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement