C2371: ✀printf✀ : redefinition; different basic types
#include "stdio.h"#include "stdlib.h"#define SIZE 10struct student//建立结构体类型{int num;//定义学号char name[20];//定义姓名float score[3];//定义三门课的成绩float aver;//平均成绩}student[SIZE]; int main() { void input(struct student stu[]); //函数声明 struct student top(struct student stu[]); //函数声明 void print(struct student stu); //函数声明 struct student stu[SIZE],*p=stu; //定义结构体数组和指针 input(p); //调用input函数 print(top(p)); //调用print函数,以max的返回值作为实参 return 0; } void input(struct student stu[]) //定义input函数 { int i; printf("请输入学生的信息:学号、姓名、三门课成绩:尀n"); printf("* 学号 * 姓名 * 三门课成绩 * 尀n"); for(i=0;i<SIZE;i++) { scanf("%d %s %f %f %f",&stu[i].num,stu[i].name,&stu[i].score[0],&stu[i].score[1],&stu[i].score[2]); //输入学生数据信息 stu[i].aver=(stu[i].score[0]+stu[i].score[1]+stu[i].score[2])/3.0; //求平均成绩 } } struct student top(struct student stu[]) //定义max函数{ int i,m=0; //用m存放成绩最高的学生在数组中的序号 for(i=0;i<SIZE;i++) if(stu[i].aver>stu[m].aver) //找出平均成绩最高的学生在数组中的序号 m=i; return stu[m]; //返回包含该生信息的结构体元素 } void printf(struct student stud) //定义print函数 { printf("*学号:%d尀n*姓名:%s尀n*三门课成绩:%6.1f,%6.1f,%6.1f尀n* 平均成绩:%7.1f尀n",stud.num,stud.name,stud.score[0],stud.score[1],stud.score[2],stud.aver); }=================================一直显示error C2371: ✀printf✀ : redefinition; different basic types 求帮助用的是C++ ,文件名是 .c