这是一个控制台程序,简单的字符加密。
#include"stdio.h"
#include"string.h"
int main()
{
int result = 1;
int i;
int count = 0;
char Text[128] = {"\0"};
char cryptograph[128] = {"\0"};
while(1)
{
if(result == 1)
{
printf(“please input mingwen: \n”);
scanf("%s",&Text);
count= strlen(Text);
for(i = 0;i < count;i++)
{
cryptograph[i]=Text[i]+i+5;
}
cryptograph[i] = ‘\0’;
printf(“after miwen is %s\n”,cryptograph);
}
else if(result ==2)
{
count = strlen(Text);
for(i = 0;i < count;i++)
{
Text[i] = cryptograph[i] - i - 5;
}
Text[i] = ‘\0’;
printf(“after mingwen is: %s\n”,Text);
}
else if(result ==3)
{
break;
}
else
{
printf(“please input true : \n”);
}
printf(“please input 1 new mingwen,input 2 to jiemi,input 3 exit ; \n”);
printf(“plesse input : \n”);
scanf("%d",&result);
}
return 0;
}
简单的字符加密
最新推荐文章于 2024-04-17 09:14:21 发布