实用文档
文案大全
#include
#include
#include
#ifdef __GNUC__
#include
#include
#define clear clear
#define Sleep(x) usleep(x##000)
#endif
#ifdef _MSC_VER
#include
#include
#define clear system("cls")
#endif
#define TRUE 1
#define FAUSE 0
typedef struct per
{
char name[20];
int sex;
char IDcard[19];
char phone[12];
int build_num;
int unit_num;
int house_num;
float area;
float area_price;
float charge;
char remarks[200];
struct per *next;
}PERSON;
void zhuce ();
int login ();
PERSON *Getdata (FILE *fp);
void add_person ();
void del (PERSON *L);
void change (PERSON *L);
void sort_All (PERSON *L);
void pay (PERSON *L);
void sort_B_num (PERSON *L);
void menu_1 ();
void menu_2 ();
int main ()
{
int check,a;
printf("\t************************** Welcome !***********************");
printf("\n\t\t1.注册");
printf("\n\t\t2.登录");
printf("\n\t\t0.退出");
printf("\n\t--请输入--: ");
scanf("%d",&a);
clear;
switch(a)
{
case 0:
{
printf("\t\t--感谢使用本系统!--");
Sleep(2000);
exit(0);
}
case 1:
{
zhuce();
clear;
check = login();
while (check == FAUSE)
{
printf("\n用户名或密码错误。");
Sleep(2000);
clear;
check = login();
}
clear;
menu_1();
break;
}
case 2:
{
check = login();
while (check == FAUSE)
{
printf ("\n用户名或密码错误。");
Sleep(2000);
clear;
check = login();
}
clear;
menu_1();
break;
}
}
return 0;
}
void menu_1 ()
{
FILE *fp;
int a;
PERSON *head = NULL;
printf("\t\t*************************欢迎使用***************************");
printf("\n\t\t1.用户添加");
printf("\n\t\t2.用户修改");
printf("\n\t\t3.用户删除");
printf("\n\t\t4.用户费用信息查看");
printf("\n\t\t5.用户缴费");
printf("\n\t\t0.退出");
printf("\n\t--请输入--: ");
scanf("%d",&a);
clear;
switch(a)
{
case 0:
{
printf("--感谢使用!--");
Sleep(3000);
exit(0);
}
case 1:
{
add_person();
menu_1();
break;
}
case 2:
{
fp = fopen("data.dat","r");