文章作者:x-语言
下面的程序有错误,请帮我修改一下,非常感谢!!!
#include<dos.h>
##include<bios.h>
#include<conio.h>
#include<ctype.h>
#include<process.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#define null 0
#define ese Ox1
#define F1 Ox2
#define F2 Ox3
#define F3 Ox4
#define F4 Ox5
#define F5 Ox6
#define stu_num 50
struct student
{
int score[5];
char name[10];
char no[8];
}stu[stu_num];
main()
{
int i,j;
int sum=0;
for(i=1;i<=stu_num;i++)
{
printf("\nstudent xingming:");
scanf("%s",stu.xm);
printf("\nstudent no:");
scanf("%s",stu.no);
for(j=1;j<=stu_num;j++)
printf("stu.score[j],j++);
scanf("%d",stu.score[j]);
sum+=stu.score[j];
}
void search_xuehao()
{
printf("\nno:");
File *fp;
int re;
struct student stu
fp=fread("stu.dat","rb");
if(fp==null)
{
puts(File not exist or open error);
getch();
return;
re=0;
}
while(1)
{
printf("input no2:");
scanf("%d",&no2);
if(strcmp(stu_num,no2)!=0)
printf("error no2");
return;
re=0;
}
while(2)
{
printf("input new no:");
if(strcmp(stu_num,no)==0)
break;
puts("student score:");
printf("stu_num is:");
printf("yuwen is:");
printf("shuxue is:");
printf("yingyu is:");
printf("jisuanji is:");
printf("sum is:");
re=1;
}
if(re==0)
puts("error no")
if(re==1)
puts("ture no");
fclose(fp);
}
void search_xm()
{
while(1)
int na;
struct student stu
File *p;
fp=fopen("stu.dat","rb");
if(fp=null)
{
puts("error xingming");
getch()
exit;
na=0;
}
while(2)
{
printf("input xingming:");
scanf("%s",&xm);
if(strcmp(name,xingming)!=0)
printf("error xingming");
return;
}
while(3)
{
printf("input xingming:");
if(strcmp(name,xingming)==0)
puts("student score:");
printf("yuwen is:");
printf("shuxue is:");
printf("yingyu is:");
printf("jisuanji is:");
printf("sum is:");
na=1;
}
if(na==0)
puts("error xingming");
if(na==1)
puts("right xingming");
getch();
}
void List File(void)
{
File *fp;
int REC=0;
struct student stu
fp=fopen("stu.dat","rb");
if(fp==null)
puts("open error");
getch();
}
else
{
printf("student xuehao,name,yuwen,shuxue,yingyu,jisuanji,sum");
}
rewind(fp);
while(fread(&stu,sizeof(struct student),1,fp))
if(REC=1,REC<=stu_num,REC++)
printf("\nno:%6s,name:%8s,score:%3d,%3d,%3d,%3d,sum:%3d",
stu.no,stu.name,stu.score[1],stu.score[2],score[3],score[4],sum);
printf("\n");
fclose(fp);
getch();
}