网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

c语言自定义函数译成密码 c语言自定义函数名

求c语言高手啊!~~

# include stdio.h

创新互联专注于德保网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供德保营销型网站建设,德保网站制作、德保网页设计、德保网站官网定制、成都小程序开发服务,打造德保网络公司原创品牌,更为您提供德保网站排名全网营销落地服务。

# include time.h

# include stdlib.h

char ResultJudge(void);

void JudgeString(void);

void code(char a[]);

int * random(void);

int * s = (int *)malloc(sizeof(int)*5);

int main(void)

{

char a;

a=ResultJudge();

printf("%c\n", a);

JudgeString();

char b[100] = "Hello,World";

code(b);

int * c = random();

printf("\n");

for(int i = 0; i 5; i++)

{

printf("%d ", c[i]);

}

return 0;

}

char ResultJudge(void)

{

int x;

printf("请输入学生成绩:");

scanf("%d", x);

char a;

if(x=90)

{

a = 'A';

}

else if(x=81x90)

{

a = 'B';

}

else if(x=70x80)

{

a = 'C';

}

else if(x=60x70)

{

a = 'D';

}

else if(x=0x60)

{

a = 'E';

}

else

{

printf("请输入0到100之间的数值\n");

}

printf("\n");

return a;

}

void JudgeString(void)

{

printf("进入判断数值部分,请输入一个数值\n");

int len,x;

scanf("%d", x);

char a[5];

if(x=0x9)

len = 1;

else if(x=10x99)

len = 2;

else if(x=100x999)

len = 3;

else if(x=1000x9999)

len = 4;

else if(x=10000x99999)

len = 5;

else

printf("请输入5位数以内的数值\n");

printf("该数值为%d位数\n", len);

switch (len)

{

case 5:

a[4]=x%10;x=x/10;

case 4:

a[3]=x%10;x=x/10;

case 3:

a[2]=x%10;x=x/10;

case 2:

a[1]=x%10;x=x/10;

case 1:

a[0]=x%10;

}

for(int i = 0; i len; i++)

{

if(9 == a[i])

printf("nine ");

else if(8 == a[i])

printf("eight ");

else if(7 == a[i])

printf("seven ");

else if(6 == a[i])

printf("six ");

else if(5 == a[i])

printf("five ");

else if(4 == a[i])

printf("four ");

else if(3 == a[i])

printf("three ");

else if(2 == a[i])

printf("two ");

else if(1 == a[i])

printf("one ");

else if(0 == a[i])

printf("zero ");

else

printf("出错了~!\n");

}

printf("\n");

for(int j = len-1; j -1; j--)

{

printf("%d ", a[j]);

}

return;

}

void code(char a[])

{

printf("\n进入密码编译部分\n");

int i = 0;

int len;

while(a[i] != '\0')

{

i++;

}

len = i+1;

for(int j = 0; j len; j++)

{

if(a[j]= 'A' a[j]='Z')

{

a[j] = ((a[j]-65+4)%26)+65;

}

else if(a[j]= 'a' a[j]='z')

{

a[j] = ((a[j]-97+4)%26)+97;

}

}

printf("%s", a);

return;

}

int * random(void)

{

printf("\n进入随机数部分\n");

int c[15];

srand(time(0));

for(int i = 0; i 15; i++)

{

c[i] = rand()%15;

}

for(int j = 0; j 15; j++)

{

printf("%d ", c[j]);

}

printf("\n");

for(int k = 0,int q = 0; k 15; k++)

{

if(k != 15 k%3 == 0)

{

s[q] = c[k]+c[k+1]+c[k+2];

q++;

}

}

return s;

}

/*

你最后两个要求有点矛盾了,每三个数求一次和,并且返回主函数,每三个数的话就需要循环了,但是又不能在循环中return,所以我折中了一下,用了一个全局变量保存你需要的每三个数求和,其他都是按你要求的

*/

写一个用c语言转换密码的程序

#include stdio.h

#include string.h

void main()

{

int i,n;char str[21];

gets(str);n=strlen(str);

if(n==0) printf("error");

for(i=0;in;i++)

if((str[i]'a'||str[i]'z')(str[i]'A'||str[i]'Z'))

printf("error");

else

{

for(i=0;in;i++)

{

if((str[i]='x'str[i]='z')||(str[i]='X'str[i]='Z'))

str[i]-=22;

else str[i]+=4;

printf("%c",str[i]);

}

}

}

请教高手如何用C语言译密码?

读出每个字符,然后给它加上4就可以了,如果要还原,就用每个字符减去4.


新闻标题:c语言自定义函数译成密码 c语言自定义函数名
标题来源:http://bjjierui.cn/article/ddosgdi.html

其他资讯