C语言高手们进来帮帮我吧!帮我编一个程序
编写一个程序,接收用户输入的用户名和密码,用户名不等于abc提示用户名错误,密码不等于123提示密码错误,全部正确提示登录成功,并提示用户名!...
编写一个程序,接收用户输入的用户名和密码,用户名不等于abc提示用户名错误,密码不等于123提示密码错误,全部正确提示登录成功,并提示用户名!
展开
展开全部
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int choose();
int shutdown();
void main()
{
system("color 0b");
char admin[100]="abc";
char secret[100]="123";
char nadmin[100]={0};
char nsecret[100]={0};
do
{
printf("\n");
printf("\n");
printf("\n");printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf(" 请输入用户名:");
gets(nadmin);
system("cls");
printf("\n");
printf("\n");
printf("\n");printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf(" 请输入密码:");
gets(nsecret);
system("cls");
}while(strcmp(admin,nadmin)!=0||strcmp(secret,nsecret)!=0);
system("cls");
printf("\n");
printf("\n");
printf("\n");printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf(" !!!!!!恭喜进入,请按任意贱继续!!!!!!");
getchar();
#include<stdlib.h>
#include<string.h>
int choose();
int shutdown();
void main()
{
system("color 0b");
char admin[100]="abc";
char secret[100]="123";
char nadmin[100]={0};
char nsecret[100]={0};
do
{
printf("\n");
printf("\n");
printf("\n");printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf(" 请输入用户名:");
gets(nadmin);
system("cls");
printf("\n");
printf("\n");
printf("\n");printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf(" 请输入密码:");
gets(nsecret);
system("cls");
}while(strcmp(admin,nadmin)!=0||strcmp(secret,nsecret)!=0);
system("cls");
printf("\n");
printf("\n");
printf("\n");printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf("\n");
printf(" !!!!!!恭喜进入,请按任意贱继续!!!!!!");
getchar();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询