// xitong.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
char user[10];
char passkey[10];
int xuan;
int fanhuizhi;
int cuowu
char iduser[10];
char idkey[10];
char idput[10];
char keyput[10];
printf("****************************欢迎登录学生管理系统********************************\n");
printf("**********************************1.登录********************************\n");
printf("**********************************2.注册************************************\n");
printf("******************************请输入您的选项****************************\n");
scanf("%d",&xuan);
switch(xuan)
{
case 1:
{
printf("请输入您的帐号\n");
scanf("%s",&iduser);
FILE *fp;
fp = fopen("E:\\class test\\0104\\xiangmu\\user.txt","r");
fgets(idput,2,fp);
fanhuizhi = strcmp(idput, iduser);
if(fanhuizhi ==0;)
{
printf("请输入您的密码\n");
scanf("%s",&idkey);
FILE *fp;
fp = fopen("E:\\class test\\0104\\xiangmu\\user.txt","r");
fgets(keyput,2,fp);
fanhuizhi = strcmp(keyput, idkey);
if(fanhuizhi ==0;)
{
printf("登录成功,欢迎使用!\n");
void zhucaidan();
zhucaidan();
}
else if(int cuowu=3;cuowu>=0;cuowu--)
{
printf("登录失败,请重新输入!\n");
}
}
}
else
{
printf("您输入的帐号不存在\n");
}
}
}
break;
}
case 2:
{
printf("请输入您注册的帐号");
scanf("%s",&user);
FILE *fp;
fp = fopen("E:\\class test\\0104\\xiangmu\\user.txt","a");
fputs(user,fp);
fclose(fp);
printf("请输入您注册的密码");
scanf("%s",&passkey);
fp = fopen("E:\\class test\\0104\\xiangmu\\user.txt","a");
fputs(passkey,fp);
fclose(fp);
printf("恭喜你,注册成功!\n");
void zhucaidan();
zhucaidan();
}
}
return 0;
}
void zhucaidan()
{
printf("**********1、录入学生信息*********\n");
printf("**********2、显示学生信息*********\n");
printf("**********3、查询学生信息*********\n");
printf("**********4、修改学生信息*********\n");
printf("**********5、删除学生信息*********\n");
printf("**********6、退出管理系统*********\n");
}
麻烦大牛看看 我已经把viod函数声明在登录成功之后
DOUBLE_l
DOUBLE_l
相关分类