Last active
November 15, 2018 10:22
-
-
Save dertst/3605aef4b578c227f534c7d4277e6ccc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include <stdio.h> | |
#include <Windows.h> | |
void Vvod(char **arr,int &d,int &size) | |
{ | |
int i=0; | |
while(i != EOF) | |
{ | |
scanf_s( "%c", &arr[i]); | |
i++; | |
} | |
} | |
void Shifrovka(char **arr, int &d, int &size) | |
{ | |
for (int i = 0; i < size; i++) | |
{ | |
for (int j = 0; j < d; j++) | |
{ | |
printf("%c", arr[i][j]); | |
} | |
} | |
} | |
void Deshifrovka(char **arr, int &d, int &size) | |
{ | |
for (int i = 0; i < size; i++) | |
{ | |
for (int j = 0; j < d; j++) | |
{ | |
printf("%c", arr[i][j]); | |
if ((i%size == 0) || (i%size == 1) || (i%size == 2) || (i%size == 3)) | |
{ | |
printf("\n"); | |
} | |
} | |
} | |
} | |
int main() | |
{ | |
printf("vvedite clych"); | |
printf("\n"); | |
int size; | |
int d; | |
scanf_s("%d",&d); | |
printf("\n"); | |
printf("vvedite dlinnu palki"); | |
printf("\n"); | |
scanf_s("%d",&size); | |
printf("\n"); | |
char **arr; | |
arr = (char **)malloc((d*size) * sizeof(int)); | |
Vvod(arr,d,size); | |
Shifrovka(arr, d, size); | |
Deshifrovka(arr, d, size); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment