c语言的登录小程序那错了???? - 爱问答

(爱问答)

c语言的登录小程序那错了????

#include<stdio.h>

#include<stdlib.h>     /*头文件和函数声明部分*/

void abc(int ,int );

void def(char *,char *);

void main()

{char* a[1]={"ghost_haha"}; char* b[1]={"ghost"};char c,d;int g=0,h=0,m=0,n=0;

printf("login:      ");

scanf("%c",&c);

fflush(stdin);

printf("passwold:    ");       /*输入.检测和函数调用部分*/

scanf("%c",&d);

fflush(stdin);

if(c==*a[0]&&d==*b[0])

{abc(g,h);}

else

{printf("You can try again,You have three chances to reenter it ");

def(a[0],b[0]);}

}

void abc(int i,int j)

{int a=0,b=0,c=0,d=0;

printf("Wlcome to the server ");

printf("And what do you want to enter? ");

printf("History:1 Data:2 Command:3 About us:4 please enter a number enter:    ");

do

{scanf("%d",&a);

b=a;

switch(a=b)

{case 1:printf("2018/7/1");break;

case 2:printf("  the PC");break;

case 3:printf("ping,netstat,net,start");break;

case 4:printf("We ");break;

}

while(a!=-1);

}

void def(char *k,char *l)

{char a=0,b=0;int c=0,d=0,e=0;

do

{printf("login:     ");

scanf("%c",a);

fflush(stdin);

printf("passworld:    ");

scanf("%c",b);

fflush(stdin);

if(a==*k&&b==*l)

{abc(d,e);}

else

{printf("please try again ");

++c;}}

while(c<3)

}


函数abc里do while循环缺少后半个},导致后面都报错了

还有后面有几个scanf没有对变量取地址,例如scanf("%c",a);应该改为scanf("%c",&a);

相关标签:c语言

下一篇:你好!我出厂设置路由器后还是无法用登入管理页面账号密码都是错的,也不知道是不是用这admin

上一篇:编写函数一个函数,将一个字符串中的大写字母转换成小写字母,将空格变成逗号。使用指针来实现。

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?