#if !defined(__HEADER_OTHERS)
#define __HEADER_OTHERS
#if !defined(EOF)
#include<stdio.h>
#endif
#if !defined(ULONG_MAX)
#include<limits.h>
#endif
short set_key(short *key){
printf("Input key:");
scanf("%d",key);
*key%=(26*26*26);
return(*key);
}
short input_massage(short *key){
char ch;
FILE *fp;
unsigned long int num=0;
if((fp=fopen("cypher.txt","w"))==NULL)
return(-1);
puts("Input massage");
while((ch=tolower(getch()))!='\r'&&num<ULONG_MAX){
putchar(ch);
fputc(scramble(&ch,*key),fp);
if(ch=='\b'&&num){
if(*key)
*key-=1;
else
*key=26*26*26-1;
num--;
}else{
*key=(*key+1)%(26*26*26);
num++;
}
}
fclose(fp);
return(0);
}
short output_cypher(void){
char ch;
FILE *fp;
if((fp=fopen("cypher.txt","r"))==NULL)
return(-1);
while((ch=fgetc(fp))!=EOF)
putchar(ch);
fclose(fp);
return(0);
}
#endif