如何实现用户输入用户名

更新时间:02-02 教程 由 孤己i 分享

如何实现用户输入用户名?

代码示例:

#include

#include

void

main()

{

int

i=0;

while(i<3)

{

printf(

"输入用户名bai:");

char

name[10],psw[10];

scanf("%s",name);

printf("输入密码:");

scanf("%s",psw);

if((strcmp(name,"abc")==0)&&(strcmp(psw,"123456"))==0)

{

printf("welcome

to

use

the

software\n");

break;

}

i++;

}

if(i>=3)

{

printf("password

error!you

can

not

use

software\n");

}

}

声明:关于《如何实现用户输入用户名》以上内容仅供参考,若您的权利被侵害,请联系13825271@qq.com
本文网址:http://www.25820.com/tutorial/14_2275240.html