亲亲亲,请#include <stdio.h>
#include <string.h>
#define USERNAME "admin"
#define PASSWORD "admin"
void main ()
{
char username[20];
char password[20];
printf("请输入用户名");
gets(username);
printf("请输入用户密码");
gets(password);
while(strcmp( USERNAME,username)!=0 || strcmp( PASSWORD,password)!=0)
{
printf("用户名或密码输入错误,请重新输入");
gets(username);
printf("\n");
gets(password);
}
printf("恭喜您,登录成功");
}
#include <string.h>
#define USERNAME "admin"
#define PASSWORD "admin"
void main ()
{
char username[20];
char password[20];
printf("请输入用户名");
gets(username);
printf("请输入用户密码");
gets(password);
while(strcmp( USERNAME,username)!=0 || strcmp( PASSWORD,password)!=0)
{
printf("用户名或密码输入错误,请重新输入");
gets(username);
printf("\n");
gets(password);
}
printf("恭喜您,登录成功");
}