"void __cdecl print(struct student * const)" (?print@@YAXQAUstudent@@@Z)什么意思?
帮我看看这个程序哪错了#include<stdio.h>inti=0;structstudent{intnum;charname[20];doublescore1,sco...
帮我看看这个程序哪错了
#include <stdio.h>
int i=0;
struct student
{
int num;
char name[20];
double score1,score2,score3;
double all;
double ave;
}stu[50];
void input(struct student stu1[]);
void print(struct student stu2[]);
void print1(struct student stu3[]);
void main ()
{
char ch=' ';
do {
input(stu);
printf("Are you continue?(Y or N)\n");
fflush(stdin);
scanf("%c",&ch);
}
while(ch=='y'||ch=='Y');
print(stu);
print1(stu);
}
void input(struct student stu1[])
{
printf("please input the student's number.\n");
scanf("%d",&stu[i].num);
printf("please input the student's name.\n");
fflush(stdin);
scanf("%s",&stu[i].name);
printf("please input the student's score1.\n");
scanf("%f",&stu[i].score1);
printf("please input the student's score2.\n");
scanf("%f",&stu[i].score2);
printf("please input the student's score3.\n");
scanf("%f",&stu[i].score3);
stu[i].all=stu[i].score1+stu[i].score2+stu[i].score3;
stu[i].ave=stu[i].all/3;
i++;
}
void ptint(struct student stu2[])
{
int j;
for(j=0;j<=i;j++)
{
printf("number\tname\n");
printf("%d\t%s\n",stu[j].num,stu[j].name);
printf("score1\tsore2\tscore3\tallscore\tave\n");
printf("%f\t%f\t%f\t%f\t%f\n",stu[j].score1,stu[j].score2,stu[j].score3,stu[j].all,stu[j].ave);
}
}
void print1(struct student stu3[])
{
double allscore1[50],allscore2[50],allscore3[50],allscore[50];
double avescore1,avescore2,avescore3,aveallscore;
int ii;
for(ii=0;ii<i;ii++)
{
allscore1[ii]+=stu[ii].score1;
allscore2[ii]+=stu[ii].score2;
allscore3[ii]+=stu[ii].score3;
allscore[ii]+=stu[ii].all;
};
avescore1=allscore1[i]/i;
avescore2=allscore2[i]/i;
avescore3=allscore3[i]/i;
aveallscore=allscore[i]/i;
printf("allscore1\tallscore2\tallscore3\n");
printf("%f\t%f\t%f\n",allscore1[i],allscore2[i],allscore3[i]);
printf("avescore1\tavescore2\tavescore3\taveallscore\n");
printf("%f\t%f\t%f\t%f\n",avescore1,avescore2,avescore3,aveallscore);
} 展开
#include <stdio.h>
int i=0;
struct student
{
int num;
char name[20];
double score1,score2,score3;
double all;
double ave;
}stu[50];
void input(struct student stu1[]);
void print(struct student stu2[]);
void print1(struct student stu3[]);
void main ()
{
char ch=' ';
do {
input(stu);
printf("Are you continue?(Y or N)\n");
fflush(stdin);
scanf("%c",&ch);
}
while(ch=='y'||ch=='Y');
print(stu);
print1(stu);
}
void input(struct student stu1[])
{
printf("please input the student's number.\n");
scanf("%d",&stu[i].num);
printf("please input the student's name.\n");
fflush(stdin);
scanf("%s",&stu[i].name);
printf("please input the student's score1.\n");
scanf("%f",&stu[i].score1);
printf("please input the student's score2.\n");
scanf("%f",&stu[i].score2);
printf("please input the student's score3.\n");
scanf("%f",&stu[i].score3);
stu[i].all=stu[i].score1+stu[i].score2+stu[i].score3;
stu[i].ave=stu[i].all/3;
i++;
}
void ptint(struct student stu2[])
{
int j;
for(j=0;j<=i;j++)
{
printf("number\tname\n");
printf("%d\t%s\n",stu[j].num,stu[j].name);
printf("score1\tsore2\tscore3\tallscore\tave\n");
printf("%f\t%f\t%f\t%f\t%f\n",stu[j].score1,stu[j].score2,stu[j].score3,stu[j].all,stu[j].ave);
}
}
void print1(struct student stu3[])
{
double allscore1[50],allscore2[50],allscore3[50],allscore[50];
double avescore1,avescore2,avescore3,aveallscore;
int ii;
for(ii=0;ii<i;ii++)
{
allscore1[ii]+=stu[ii].score1;
allscore2[ii]+=stu[ii].score2;
allscore3[ii]+=stu[ii].score3;
allscore[ii]+=stu[ii].all;
};
avescore1=allscore1[i]/i;
avescore2=allscore2[i]/i;
avescore3=allscore3[i]/i;
aveallscore=allscore[i]/i;
printf("allscore1\tallscore2\tallscore3\n");
printf("%f\t%f\t%f\n",allscore1[i],allscore2[i],allscore3[i]);
printf("avescore1\tavescore2\tavescore3\taveallscore\n");
printf("%f\t%f\t%f\t%f\n",avescore1,avescore2,avescore3,aveallscore);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询