Skip to content

Instantly share code, notes, and snippets.

@dertst
Created November 23, 2018 17:45
Show Gist options
  • Save dertst/4ce4aca0690b1e8b35c09e1908a45e5f to your computer and use it in GitHub Desktop.
Save dertst/4ce4aca0690b1e8b35c09e1908a45e5f to your computer and use it in GitHub Desktop.
#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