sch9_ctf_3/tasks/Зашифрованный файл/Исходники/encrypt_file.cpp

32 lines
602 B
C++
Raw Normal View History

#include <stdio.h>
#include <stdlib.h>
const int maxsize = 33;
char line[maxsize+1];
char ans[maxsize+1];
FILE * file;
void copying() {
for (int i = 0; i < maxsize; ++i) {
ans[i] = line[i];
}
}
void orexclusive() {
for (int i = 0; i < maxsize; i+=2, ans[i]^='^'-'|'+'&') {}
}
int main(int argc, char * argv[]) {
file = fopen("flag.txt", "r");
if (file == NULL)
printf("File does not exist!\n");
else {
fgets(line, maxsize+1, file);
copying();
orexclusive();
printf("%s\n", ans);
fclose(file);
}
return 0;
}