All pastes #738699 Raw Edit

Someone

public text v1 · immutable
·published 2007-10-16 15:42 UTC
rendered paste body
#include<stdio.h>

main() {

FILE *f,*p;
char prot[50],stoxos[50],x,c;
int kleidi;

printf("\nDose to onoma tou arxeiou gia kryptografisi: ");
gets(prot);

f=fopen(prot,"r");

printf("\nDose to onoma tou kryptografimenou arxeiou: ");
gets(stoxos);

p=fopen(stoxos,"w");

if (!f) {
	printf("\nTo prototypo arxeio den vrethike!!!\n");
	return;
}

if (!p) {
	printf("\nApotyxia deysmeysis mnimis gia to arxeio stoxos!\n");
	return;
}

printf("\n Dose enan akeraio arithmo gia kleidi tis kryptografisis: ");
scanf("%d", &kleidi);
kleidi=kleidi%25+1;

while (!feof(f)) {
	f=fgetc(x);
	if (x>='A' && x<='Z') {
		c=x+kleidi;
		if (c>90)
			c=c-26;
		fputc(c,p);
	}
	else
		fputc(x,p);
}

fclose(f);
fclose(p);

}