#include <stdio.h>
#define N 100
char convert(char);
int main(int argc, int *argv[])
{
char str0[N],str1[N],str2[N];
char c;
int i;
printf("plese input proclaimed in writing:");
gets(str0);
printf("the cryptograph is :");
for (i = 0 ; i <= strlen(str0); i++)
{
str1[i] = convert(str0[i]);
}
puts(str1);
printf("the resolve cryptograph is :");
for (i = 0 ; i <= strlen(str1); i++)
{
str2[i] = convert(str1[i]);
}
puts(str2);
system("pause");
}
char convert(char c)
{
char c_convert ;
if (c >= 'A' && c <= 'Z')
{
c_convert = 155 - c;
}
else if (c >= 'a' && c <= 'z')
{
c_convert = 219 - c;
}
else
{
c_convert = c;
}
return c_convert;
}
|