All pastes #741446 Raw Edit

cryptage

public c v1 · immutable
·published 2007-10-18 18:28 UTC
rendered paste body
#include <stdio.h>#define X 5#define N 8char apres_crypt[N];void cryptage(char av,char i);int main(){	char av, i;	for(i=0; i<N; i++)	{		av = getchar();		if(((av>=0x41)&&(av<=0x5A))||((av>=0x61)&&(av<=0x7A)))		{			cryptage(av, i);		}		else			apres_crypt[i] = av ;	}		printf("Le mot crypté est : ");	for(i=0; i<N; i++)	{		printf("%c", &apres_crypt[i]);	}	return (0);}void cryptage(char av, char i){	av = av + X;	if((av>0x5A)&&(av<0x61))	{		av = av - 26;	}	if(av>0x7A)	{		av = av - 26;	}	apres_crypt[i] = av;}