售楼系统源代码#include"conio.h" #include"stdio.h" #include"stdlib.h" #include"string.h" #define MAX 100 #define N 3 struct chaoxiang_type/* 日期结构体类型 */ { int danyu; int loucen; }; struct loupans_type { char num[8]; /* 楼号 */ char price[20]; /* 价格 (/㎡)*/ char chaoxiang[20]; /* 面向*/ int area; /* 面积 */ struct chaoxiang_type weizhi; /* 单元信息 */ struct chaoxiang_type kind; /* 类型*/ }; struct user_type // 用户信息结构体{ char username[15], password[15]; }user; int number; int m; //登录选择/* 读取信息模块 */ int read_file(struct loupans_type loupan[]) { FILE *fp; int i=0; if((fp=fopen("loupans.txt","rt"))==NULL) {printf("\n 库存文件不存在,请创建!\n"); return 0; } while(!feof(fp)) { fread(&loupan[i],sizeof(struct loupans_type),1,fp); if(loupan[i].num==0) break; else i++; } fclose(fp); return i; } /* 保存信息模块 */ void save_file(struct loupans_type loupan[],int sum) { FILE *fp; int i; if((fp=fopen("loupans.txt","wt"))==NULL) { printf(" 读文件错误 \n"); return; } for(i=0;i