麻烦高手看看我的代码,我改来改去,不知道那里有错误!

来源:百度知道 编辑:UC知道 时间:2024/05/18 05:51:31
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void chaxun();
void chaxun1();
void denglu();
struct student
{
int xuehao;
char xingming[10];
}stu[20]={
{1,"kkkk"},
{2,"hhhh"},
};
int count=6;
void chaxun1()
{
char s='o';
int sc;
printf("\n\n\n\t\t\t\t欢迎进入本查询系统\n");
do{

if (sc<count)
{
printf("\n\n\t学号 姓名 \n");
printf("\n\n\t%d\t%s",stu[sc].xuehao,stu[sc].xingming);
}
else
{
printf("\n\n\t\t\t\t没找到!\n");
}

printf("\n\n\t\t\t\t要不要继续查询?\n\n\n\t\t\t\t(y):是 (n):不 ");
fflush(stdin);

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void chaxun();
int chaxun1();
void denglu();
struct student
{
int xuehao;
char xingming[10];
}stu[6]={
{1,"kkkk"},
{2,"hhhh"},
{3,"aaaa"},
{4,"ssss"},
{5,"dddd"},
{6,"ffff"}
};
int count=6;
int chaxun1()
{
int a=1;

char answer='y';
//
char username[10],mima[10];
printf("\n\t\t\t请输入用户名:");
gets(username);
printf("\n\t\t\t请输入密码:");
gets(mima);

if((strcmp(mima,"123")==0))
{
printf("\n\n\n\n\t\t\t登陆成功!!!\n");
denglu();
return 1;
}
else
{
system("cls");
printf("\n\n\n\n\t\t\