新手上路 望指教
#include "stdio.h"#define N 3
struct add{
int xuehao[],chengji[];
char xingming[];
float xingbie,zhuzhi;
};
void a(struct add a1[]);
void a(struct add a1[])
{
int i;
printf("please input :\n");
for(i=0;i<N;i++)
{
scanf("%s%d%d%d%f%f",a1[i].xingming[i],a1[i].xuehao,a1[i].chengji,a1[i].zhuzhi,a1[i].xingbie);
}
}
struct add b(struct add a1[]);
struct add b(struct add a1[])
{
int i,j;
float max=0,min=0;
for(i=0;i<N;i++)
{
for(j=1;j<10;j++)
{
if(a1[j].chengji>a1[max].chengji)
max=j;
}
for(j=1;j<10;j++)
{
if(a1[j].chengji<a1[min].chengji)
min=j;
}
}
return a1[max],a1[min];
}
struct add c(struct add a1[]);
struct add c(struct add a1[])
{
int i,j,sum=0,sum1=0;
for(i=0;i<N;i++)
{
for(j=0;j<10;j++)
{
if(a1[j].chengji<60) 错误说:Cannot convert 'int' to 'int *'
sum++;
}
if(sum==10)
sum1++;
}
return sum1; 错误说:Cannot convert 'int' to 'int add'
}
void d(struct add a1[]);
void d(struct add a1[])
{
int i;
printf("please input xuehao:");
scanf("%d",&i);
printf("%s%d%d%d%f%f",a1[i].xingming,a1[i].xuehao,a1[i].chengji,a1[i].zhuzhi,a1[i].xingbie);
}