• ADADADADAD

    如何用c语言进行数据加密[ 网络知识 ]

    网络知识 时间:2024-11-20 12:07:22

    作者:文/会员上传

    简介:

    使用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);

    }

    如何用c语言进行数据加密.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: 数据加密c语言