学生宿舍管理系统测试文档
答案:1 悬赏:70
解决时间 2021-11-05 20:36
- 提问者网友:做自己de王妃
- 2021-11-05 00:37
学生宿舍管理系统测试文档
最佳答案
- 二级知识专家网友:上分大魔王
- 2021-11-05 01:47
我这边有两个!希望可以帮到你! 第一个VC #include "stdafx.h" #include "stdio.h" #include "iostream.h" #include "string.h" #define ERROR 0 #define OK 1 #define MAXSIZE 2500 #define EQ(a,b) ((a)==(b)) typedef int Status; int N=4;//全局变量来储存所输入的个数; struct student { //数据结构类型; char name[10]; int num; int room; }; Status Input() { //数据输入; int i=0; int flag=1; char ch; FILE * fpdata; student stu[MAXSIZE]; if((fpdata=fopen("studata.txt","wb"))==NULL){printf(" ile!");returnERROR;}while(flag){printf("是否继续输入(Y/N):");cin>>ch;if(ch=='y'||ch=='Y'){scanf("%s%d%d",stu[i].name,&stu[i].num,&stu[i].room);fwrite(&stu[i],sizeof(structstudent),1,fpdata);i++;}elseflag=0;}N=i;fclose(fpdata);printf("数据输入完成!\n");returnOK;}StatusPrint(char*filename){//输出数据;FILE*fpdata;studentst;inti=0;if((fpdata=fopen(filename,"rb"))==NULL){printf(" ile!");returnERROR;}while(i
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯