12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
网络知识 时间:2024-11-20 12:07:22
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
使用c语言对数据进行加密,具体方法如下:#include void main(){int a[5];int num, temp, encripy; int i;do{printf("Please input the number:");scanf("%d",&num);if(!(num/1
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
使用c语言对数据进行加密,具体方法如下:
#include
void main()
{
int a[5];
int num, temp, encripy;
int i;
do
{
printf("Please input the number:");
scanf("%d",&num);
if(!(num/10000 !=0 && num/100000==0))
printf("Data error!\n");
}while(!(num/10000 !=0 && num/100000==0));
a[0] = num/10000%10;
a[1] = num/1000%10;
a[2] = num/100%10;
a[3] = num/10%10;
a[4] = num%10;
for(i = 0; i < 5; ++i)
a[i] = (a[i] + 8)%10;
temp = a[0];
a[0] = a[3];
a[3] = temp;
temp = a[1];
a[1] = a[2];
a[2] = temp;
encripy = a[0]*10000 + a[1]*1000 + a[2]*100 + a[3]*10 + a[4];
printf("\nThe scourse number: %d\n", num);
printf("\nEncripy the number: %d\n\n", encripy);
}
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19