-
-
Save dertst/4ce4aca0690b1e8b35c09e1908a45e5f 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 "pch.h" | |
#include <cstdio> | |
#include "string.h" | |
#include <conio.h> | |
#include <stdio.h> | |
void Vvod(char s[],int &key,int &size) | |
{ | |
FILE *f; | |
fopen_s(&f, "C:\\temp\\skitala.txt", "rt"); | |
for (int i = 0;i < key; i++) | |
{ | |
fgets(s, size*key, f); | |
puts(s); | |
} | |
fclose(f); | |
} | |
void shifrovanie(char s[], int &key, int &size, int symbols) | |
{ | |
FILE *f; | |
fopen_s(&f, "C:\\temp\\skitala.txt", "rt"); | |
for (int j = 0; j <key; j++) | |
{ | |
for (int i = 0; i < size; i++) | |
{ | |
printf("%c",s[i]); | |
} | |
} | |
} | |
int main() | |
{ | |
char s[255]; | |
int key; | |
int size; | |
scanf_s("%d", &key); | |
scanf_s("%d", &size); | |
int symbols = key * size; | |
Vvod(s,key,size); | |
shifrovanie(s, key, size,symbols); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment