
一道c语言文件题!急用!!
⑴输入5个学生的信息:学号(6位整数)、姓名(6个字符)、3门课的成绩(3位整数1位小数)。计算每个学生的平均成绩(3位整数2位小数),将所有数据写入文件STU1.DAT...
⑴ 输入5个学生的信息:学号(6位整数)、姓名(6个字符)、3门课的成绩(3位整数1位小数)。计算每个学生的平均成绩(3位整数2位小数),将所有数据写入文件STU1.DAT;
⑵ 从STU1.DAT文件中读入学生数据,按平均成绩从高到低排序后写入文件STU2.DAT;
⑶ 按照输入学生的学号,在STU2.DAT文件中查找该学生,找到以后输出该学生的所有数据,如果文件中没有输入的学号,给出相应的提示信息。
我做了这个程序的就是不能运行!我编写的代码是:
、# include<stdio.h>
# define SIZE 5
# include<stdlib.h>
struct student_type
{
char name[20];
int num;
int chengji[3];
float avg;
}stud[SIZE];
main()
{
FILE *p1,*p2;
int i,j,sum=0,n,m,change;(输入stud【SIZE】的成绩名字)
for(i=0;i<SIZE;i++)
{
scanf("%s",stud[i].name);
scanf("%d",&stud[i].num);
for(j=0;j<3;j++)
{
scanf("%d",stud[i].chengji[j]);
sum+=stud[i].chengji[j];
}
stud[i].avg=sum/3;
}
if((p1=fopen("d:\\stud_list.txt","w"))==NULL)(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stud[i],sizeof(struct student_type),1,p1)!=1)
printf("file write error\n");
}
printf("wen jian de nei rong shi :\n");
for(i=0;fread(&stud[i],sizeof(struct student_type),1,p1)!=0;i++)(读出p1中的数并在屏幕上打印出来)
{
printf("\n%s",stud[i].name);
for(j=0;j<3;j++)
printf("%4d%4d%4d",stud[i].chengji[j],stud[i].chengji[j],stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
fclose(p1);
n=i;
for(i=0;i<n;i++)(用冒泡发对数组中的平均数排序)
for(j=i+1;j<n;j++)
if(stud[i].avg<stud[j].avg)
{
change=stud[i].avg;
stud[i].avg=stud[j].avg;
stud[j].avg=change;
}
printf("\nshu chu pai xu hou :");
if((p2=fopen("d:\\stud.txt","w"))==NULL)(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
for(i=0;i<n;i++)
{
fwrite(&stud[i],sizeof(struct student_type),1,p2);
printf("\n%s",stud[i].name);
for(j=0;j<3;j++)
printf("%4d",stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
printf("print the num you want to found:");(输入你要查找的人的学号)
scanf("%d",&m);
while(1)(打印出你要找的人的全部信息)
{
fread(&stud[m],sizeof(struct student_type),1,p2);
printf("%s%d",stud[m].name,stud[m].num);
for(i=0;i<3;i++)
printf("%d",stud[m].chengji[i]);
printf("%d",stud[m].avg);
}
fclose(p2);
}
我想很快的知道答案,最好是现在就好!!谢谢了 展开
⑵ 从STU1.DAT文件中读入学生数据,按平均成绩从高到低排序后写入文件STU2.DAT;
⑶ 按照输入学生的学号,在STU2.DAT文件中查找该学生,找到以后输出该学生的所有数据,如果文件中没有输入的学号,给出相应的提示信息。
我做了这个程序的就是不能运行!我编写的代码是:
、# include<stdio.h>
# define SIZE 5
# include<stdlib.h>
struct student_type
{
char name[20];
int num;
int chengji[3];
float avg;
}stud[SIZE];
main()
{
FILE *p1,*p2;
int i,j,sum=0,n,m,change;(输入stud【SIZE】的成绩名字)
for(i=0;i<SIZE;i++)
{
scanf("%s",stud[i].name);
scanf("%d",&stud[i].num);
for(j=0;j<3;j++)
{
scanf("%d",stud[i].chengji[j]);
sum+=stud[i].chengji[j];
}
stud[i].avg=sum/3;
}
if((p1=fopen("d:\\stud_list.txt","w"))==NULL)(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stud[i],sizeof(struct student_type),1,p1)!=1)
printf("file write error\n");
}
printf("wen jian de nei rong shi :\n");
for(i=0;fread(&stud[i],sizeof(struct student_type),1,p1)!=0;i++)(读出p1中的数并在屏幕上打印出来)
{
printf("\n%s",stud[i].name);
for(j=0;j<3;j++)
printf("%4d%4d%4d",stud[i].chengji[j],stud[i].chengji[j],stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
fclose(p1);
n=i;
for(i=0;i<n;i++)(用冒泡发对数组中的平均数排序)
for(j=i+1;j<n;j++)
if(stud[i].avg<stud[j].avg)
{
change=stud[i].avg;
stud[i].avg=stud[j].avg;
stud[j].avg=change;
}
printf("\nshu chu pai xu hou :");
if((p2=fopen("d:\\stud.txt","w"))==NULL)(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
for(i=0;i<n;i++)
{
fwrite(&stud[i],sizeof(struct student_type),1,p2);
printf("\n%s",stud[i].name);
for(j=0;j<3;j++)
printf("%4d",stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
printf("print the num you want to found:");(输入你要查找的人的学号)
scanf("%d",&m);
while(1)(打印出你要找的人的全部信息)
{
fread(&stud[m],sizeof(struct student_type),1,p2);
printf("%s%d",stud[m].name,stud[m].num);
for(i=0;i<3;i++)
printf("%d",stud[m].chengji[i]);
printf("%d",stud[m].avg);
}
fclose(p2);
}
我想很快的知道答案,最好是现在就好!!谢谢了 展开
3个回答
展开全部
真是工作量不小啊,,哈哈!调试完了,觉得好多多加分!
# include<stdio.h>
# define SIZE 5
# include<stdlib.h>
struct student_type
{
char name[20];
int num;
int chengji[3];
float avg;
}stud[SIZE];
void main()
{
FILE *p1,*p2;
int i,j,sum=0,n,m;
for(i=0;i<SIZE;i++)
{
sum =0; //添加
printf("请按格式输入stud[%d]的名字 学号 成绩1 成绩2 成绩3\n" ,i); //修改处
scanf("%s",stud[i].name);
scanf("%d",&stud[i].num);
for(j=0;j<3;j++)
{
scanf("%d",&stud[i].chengji[j]); //修改处
sum+=stud[i].chengji[j];
}
stud[i].avg=(float)sum/3; //修改
}
if((p1=fopen("d:\\stud_list.txt","w+"))==NULL)//(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stud[i],sizeof(struct student_type),1,p1)!=1)
printf("file write error\n");
}
fclose(p1);
if((p1=fopen("d:\\stud_list.txt","rb"))==NULL)//添加(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
printf("wen jian de nei rong shi :\n");
for(i=0;fread(&stud[i],sizeof(struct student_type),1,p1)!=0;i++)//(读出p1中的数并在屏幕上打印出来)
{
printf("\n%s",stud[i].name);
printf("%10d",stud[i].num);
for(j=0;j<3;j++)
printf("%4d ",stud[i].chengji[j]); //修改
printf("%10.2f",stud[i].avg);
}
printf("\n"); //添加
fclose(p1);
n=i;
student_type change; //修改
change =stud[0]; //修改
for(i=0;i<n;i++)//(用冒泡发对数组中的平均数排序)
for(j=i+1;j<n;j++)
if(stud[i].avg<stud[j].avg)
{
change=stud[i];
stud[i]=stud[j];
stud[j]=change;
}
printf("\nshu chu pai xu hou :");
if((p2=fopen("d:\\stud.txt","w+"))==NULL)//(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
for(i=0;i<n;i++)
{
fwrite(&stud[i],sizeof(struct student_type),1,p2);
printf("\n%s",stud[i].name);
printf("%10d",stud[i].num);//添加
for(j=0;j<3;j++)
printf("%4d",stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
fclose(p2);
printf("\n");
student_type find; //修改
while(1)//(打印出你要找的人的全部信息)
{
if((p2=fopen("d:\\stud.txt","rb"))==NULL)//(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
printf("print the num you want to found:\n");//(输入你要查找的人的学号)
scanf("%d",&m);
while(!feof(p2))
{
fread(&find,sizeof(struct student_type),1,p2);
if(find.num==m)
{
printf("%s %10d",find.name,find.num);
for(i=0;i<3;i++)
printf("%5d",find.chengji[i]);
printf("%10.3f",find.avg);
printf("\n");
break;
}
}
if(feof(p2))
printf("input wrong num, please input again\n");
fclose(p2);
}
}
# include<stdio.h>
# define SIZE 5
# include<stdlib.h>
struct student_type
{
char name[20];
int num;
int chengji[3];
float avg;
}stud[SIZE];
void main()
{
FILE *p1,*p2;
int i,j,sum=0,n,m;
for(i=0;i<SIZE;i++)
{
sum =0; //添加
printf("请按格式输入stud[%d]的名字 学号 成绩1 成绩2 成绩3\n" ,i); //修改处
scanf("%s",stud[i].name);
scanf("%d",&stud[i].num);
for(j=0;j<3;j++)
{
scanf("%d",&stud[i].chengji[j]); //修改处
sum+=stud[i].chengji[j];
}
stud[i].avg=(float)sum/3; //修改
}
if((p1=fopen("d:\\stud_list.txt","w+"))==NULL)//(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stud[i],sizeof(struct student_type),1,p1)!=1)
printf("file write error\n");
}
fclose(p1);
if((p1=fopen("d:\\stud_list.txt","rb"))==NULL)//添加(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
printf("wen jian de nei rong shi :\n");
for(i=0;fread(&stud[i],sizeof(struct student_type),1,p1)!=0;i++)//(读出p1中的数并在屏幕上打印出来)
{
printf("\n%s",stud[i].name);
printf("%10d",stud[i].num);
for(j=0;j<3;j++)
printf("%4d ",stud[i].chengji[j]); //修改
printf("%10.2f",stud[i].avg);
}
printf("\n"); //添加
fclose(p1);
n=i;
student_type change; //修改
change =stud[0]; //修改
for(i=0;i<n;i++)//(用冒泡发对数组中的平均数排序)
for(j=i+1;j<n;j++)
if(stud[i].avg<stud[j].avg)
{
change=stud[i];
stud[i]=stud[j];
stud[j]=change;
}
printf("\nshu chu pai xu hou :");
if((p2=fopen("d:\\stud.txt","w+"))==NULL)//(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
for(i=0;i<n;i++)
{
fwrite(&stud[i],sizeof(struct student_type),1,p2);
printf("\n%s",stud[i].name);
printf("%10d",stud[i].num);//添加
for(j=0;j<3;j++)
printf("%4d",stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
fclose(p2);
printf("\n");
student_type find; //修改
while(1)//(打印出你要找的人的全部信息)
{
if((p2=fopen("d:\\stud.txt","rb"))==NULL)//(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
printf("print the num you want to found:\n");//(输入你要查找的人的学号)
scanf("%d",&m);
while(!feof(p2))
{
fread(&find,sizeof(struct student_type),1,p2);
if(find.num==m)
{
printf("%s %10d",find.name,find.num);
for(i=0;i<3;i++)
printf("%5d",find.chengji[i]);
printf("%10.3f",find.avg);
printf("\n");
break;
}
}
if(feof(p2))
printf("input wrong num, please input again\n");
fclose(p2);
}
}
展开全部
因为没在注释的地方加上注释符//或/**/,帮你改了下,可以运行了
# include<stdio.h>
# define SIZE 5
# include<stdlib.h>
struct student_type
{
char name[20];
int num;
int chengji[3];
float avg;
}stud[SIZE];
main()
{
FILE *p1,*p2;
int i,j,sum=0,n,m,change; //(输入stud【SIZE】的成绩名字)
for(i=0;i<SIZE;i++)
{
scanf("%s",stud[i].name);
scanf("%d",&stud[i].num);
for(j=0;j<3;j++)
{
scanf("%d",stud[i].chengji[j]);
sum+=stud[i].chengji[j];
}
stud[i].avg=sum/3;
}
if((p1=fopen("d:\\stud_list.txt","w"))==NULL) //(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stud[i],sizeof(struct student_type),1,p1)!=1)
printf("file write error\n");
}
printf("wen jian de nei rong shi :\n");
for(i=0;fread(&stud[i],sizeof(struct student_type),1,p1)!=0;i++) //(读出p1中的数并在屏幕上打印出来)
{
printf("\n%s",stud[i].name);
for(j=0;j<3;j++)
printf("%4d%4d%4d",stud[i].chengji[j],stud[i].chengji[j],stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
fclose(p1);
n=i;
for(i=0;i<n;i++) //(用冒泡发对数组中的平均数排序)
for(j=i+1;j<n;j++)
if(stud[i].avg<stud[j].avg)
{
change=stud[i].avg;
stud[i].avg=stud[j].avg;
stud[j].avg=change;
}
printf("\nshu chu pai xu hou :");
if((p2=fopen("d:\\stud.txt","w"))==NULL) //(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
for(i=0;i<n;i++)
{
fwrite(&stud[i],sizeof(struct student_type),1,p2);
printf("\n%s",stud[i].name);
for(j=0;j<3;j++)
printf("%4d",stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
printf("print the num you want to found:"); //(输入你要查找的人的学号)
scanf("%d",&m);
while(1) //(打印出你要找的人的全部信息)
{
fread(&stud[m],sizeof(struct student_type),1,p2);
printf("%s%d",stud[m].name,stud[m].num);
for(i=0;i<3;i++)
printf("%d",stud[m].chengji[i]);
printf("%d",stud[m].avg);
}
fclose(p2);
}
# include<stdio.h>
# define SIZE 5
# include<stdlib.h>
struct student_type
{
char name[20];
int num;
int chengji[3];
float avg;
}stud[SIZE];
main()
{
FILE *p1,*p2;
int i,j,sum=0,n,m,change; //(输入stud【SIZE】的成绩名字)
for(i=0;i<SIZE;i++)
{
scanf("%s",stud[i].name);
scanf("%d",&stud[i].num);
for(j=0;j<3;j++)
{
scanf("%d",stud[i].chengji[j]);
sum+=stud[i].chengji[j];
}
stud[i].avg=sum/3;
}
if((p1=fopen("d:\\stud_list.txt","w"))==NULL) //(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stud[i],sizeof(struct student_type),1,p1)!=1)
printf("file write error\n");
}
printf("wen jian de nei rong shi :\n");
for(i=0;fread(&stud[i],sizeof(struct student_type),1,p1)!=0;i++) //(读出p1中的数并在屏幕上打印出来)
{
printf("\n%s",stud[i].name);
for(j=0;j<3;j++)
printf("%4d%4d%4d",stud[i].chengji[j],stud[i].chengji[j],stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
fclose(p1);
n=i;
for(i=0;i<n;i++) //(用冒泡发对数组中的平均数排序)
for(j=i+1;j<n;j++)
if(stud[i].avg<stud[j].avg)
{
change=stud[i].avg;
stud[i].avg=stud[j].avg;
stud[j].avg=change;
}
printf("\nshu chu pai xu hou :");
if((p2=fopen("d:\\stud.txt","w"))==NULL) //(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
for(i=0;i<n;i++)
{
fwrite(&stud[i],sizeof(struct student_type),1,p2);
printf("\n%s",stud[i].name);
for(j=0;j<3;j++)
printf("%4d",stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
printf("print the num you want to found:"); //(输入你要查找的人的学号)
scanf("%d",&m);
while(1) //(打印出你要找的人的全部信息)
{
fread(&stud[m],sizeof(struct student_type),1,p2);
printf("%s%d",stud[m].name,stud[m].num);
for(i=0;i<3;i++)
printf("%d",stud[m].chengji[i]);
printf("%d",stud[m].avg);
}
fclose(p2);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
引用ppliang0415的回答:
真是工作量不小啊,,哈哈!调试完了,觉得好多多加分!
# include<stdio.h>
# define SIZE 5
# include<stdlib.h>
struct student_type
{
char name[20];
int num;
int chengji[3];
float avg;
}stud[SIZE];
void main()
{
FILE *p1,*p2;
int i,j,sum=0,n,m;
for(i=0;i<SIZE;i++)
{
sum =0; //添加
printf("请按格式输入stud[%d]的名字 学号 成绩1 成绩2 成绩3\n" ,i); //修改处
scanf("%s",stud[i].name);
scanf("%d",&stud[i].num);
for(j=0;j<3;j++)
{
scanf("%d",&stud[i].chengji[j]); //修改处
sum+=stud[i].chengji[j];
}
stud[i].avg=(float)sum/3; //修改
}
if((p1=fopen("d:\\stud_list.txt","w+"))==NULL)//(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stud[i],sizeof(struct student_type),1,p1)!=1)
printf("file write error\n");
}
fclose(p1);
if((p1=fopen("d:\\stud_list.txt","rb"))==NULL)//添加(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
printf("wen jian de nei rong shi :\n");
for(i=0;fread(&stud[i],sizeof(struct student_type),1,p1)!=0;i++)//(读出p1中的数并在屏幕上打印出来)
{
printf("\n%s",stud[i].name);
printf("%10d",stud[i].num);
for(j=0;j<3;j++)
printf("%4d ",stud[i].chengji[j]); //修改
printf("%10.2f",stud[i].avg);
}
printf("\n"); //添加
fclose(p1);
n=i;
student_type change; //修改
change =stud[0]; //修改
for(i=0;i<n;i++)//(用冒泡发对数组中的平均数排序)
for(j=i+1;j<n;j++)
if(stud[i].avg<stud[j].avg)
{
change=stud[i];
stud[i]=stud[j];
stud[j]=change;
}
printf("\nshu chu pai xu hou :");
if((p2=fopen("d:\\stud.txt","w+"))==NULL)//(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
for(i=0;i<n;i++)
{
fwrite(&stud[i],sizeof(struct student_type),1,p2);
printf("\n%s",stud[i].name);
printf("%10d",stud[i].num);//添加
for(j=0;j<3;j++)
printf("%4d",stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
fclose(p2);
printf("\n");
student_type find; //修改
while(1)//(打印出你要找的人的全部信息)
{
if((p2=fopen("d:\\stud.txt","rb"))==NULL)//(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
printf("print the num you want to found:\n");//(输入你要查找的人的学号)
scanf("%d",&m);
while(!feof(p2))
{
fread(&find,sizeof(struct student_type),1,p2);
if(find.num==m)
{
printf("%s %10d",find.name,find.num);
for(i=0;i<3;i++)
printf("%5d",find.chengji[i]);
printf("%10.3f",find.avg);
printf("\n");
break;
}
}
if(feof(p2))
printf("input wrong num, please input again\n");
fclose(p2);
}
}
真是工作量不小啊,,哈哈!调试完了,觉得好多多加分!
# include<stdio.h>
# define SIZE 5
# include<stdlib.h>
struct student_type
{
char name[20];
int num;
int chengji[3];
float avg;
}stud[SIZE];
void main()
{
FILE *p1,*p2;
int i,j,sum=0,n,m;
for(i=0;i<SIZE;i++)
{
sum =0; //添加
printf("请按格式输入stud[%d]的名字 学号 成绩1 成绩2 成绩3\n" ,i); //修改处
scanf("%s",stud[i].name);
scanf("%d",&stud[i].num);
for(j=0;j<3;j++)
{
scanf("%d",&stud[i].chengji[j]); //修改处
sum+=stud[i].chengji[j];
}
stud[i].avg=(float)sum/3; //修改
}
if((p1=fopen("d:\\stud_list.txt","w+"))==NULL)//(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
for(i=0;i<SIZE;i++)
{
if(fwrite(&stud[i],sizeof(struct student_type),1,p1)!=1)
printf("file write error\n");
}
fclose(p1);
if((p1=fopen("d:\\stud_list.txt","rb"))==NULL)//添加(将上面的数装入p1中)
{
printf("cannot open the file\n");
exit(0);
}
printf("wen jian de nei rong shi :\n");
for(i=0;fread(&stud[i],sizeof(struct student_type),1,p1)!=0;i++)//(读出p1中的数并在屏幕上打印出来)
{
printf("\n%s",stud[i].name);
printf("%10d",stud[i].num);
for(j=0;j<3;j++)
printf("%4d ",stud[i].chengji[j]); //修改
printf("%10.2f",stud[i].avg);
}
printf("\n"); //添加
fclose(p1);
n=i;
student_type change; //修改
change =stud[0]; //修改
for(i=0;i<n;i++)//(用冒泡发对数组中的平均数排序)
for(j=i+1;j<n;j++)
if(stud[i].avg<stud[j].avg)
{
change=stud[i];
stud[i]=stud[j];
stud[j]=change;
}
printf("\nshu chu pai xu hou :");
if((p2=fopen("d:\\stud.txt","w+"))==NULL)//(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
for(i=0;i<n;i++)
{
fwrite(&stud[i],sizeof(struct student_type),1,p2);
printf("\n%s",stud[i].name);
printf("%10d",stud[i].num);//添加
for(j=0;j<3;j++)
printf("%4d",stud[i].chengji[j]);
printf("%10.2f",stud[i].avg);
}
fclose(p2);
printf("\n");
student_type find; //修改
while(1)//(打印出你要找的人的全部信息)
{
if((p2=fopen("d:\\stud.txt","rb"))==NULL)//(将排序好了的数装入在p2中)
{
printf("cannot open the file:\n");
exit(0);
}
printf("print the num you want to found:\n");//(输入你要查找的人的学号)
scanf("%d",&m);
while(!feof(p2))
{
fread(&find,sizeof(struct student_type),1,p2);
if(find.num==m)
{
printf("%s %10d",find.name,find.num);
for(i=0;i<3;i++)
printf("%5d",find.chengji[i]);
printf("%10.3f",find.avg);
printf("\n");
break;
}
}
if(feof(p2))
printf("input wrong num, please input again\n");
fclose(p2);
}
}
展开全部
这个成绩不是得输入三个整数一个小数吗,上面程序还是有问题的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询