请高手帮我看看哪出问题啦!
// yk.cpp : 定义控制台应用程序的入口点。//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<conio.h>
struct score
{
int math;
int c;
int english;
};
struct stu
{
char name[20];
char sex;
long number;
struct score sub;
}stu[77];
void Input()
{
int i;
for(i=0;i<77;i++)
scanf("%s\n",stu[i].name);
scanf("%s\n",&stu[i].sex);
scanf("%ld\n",&stu[i].number);
scanf("%d\n",&stu[i].sub.math);
scanf("%d\n",&stu[i].sub.c);
scanf("%d\n",&stu[i].sub.english);
}
void Output()
{
int i;
for(i=0;i<77;i++)
printf("%s\t%s\t%ld\t%d\t%d\t%d\t",stu[i].name,stu[i].sex,stu[i].number,stu[i].sub.math,stu[i].sub.c,stu[i].sub.english);
}
void Information()
{
int a,i,k;
char j[20];
printf("***********Use Name(1)**********\n");
printf("***********Use Number(2)*********\n");
scanf("%d\n",a);
if(a==1)
{
scanf("%s\n",j);
for(i=1;i<77;i++)
{
if(strcmp(j,stu[i].name)==0)
printf("%s\t%s\t%ld\t%d\t%d\t%d\t",stu[i].name,stu[i].sex,stu[i].number,stu[i].sub.math,stu[i].sub.c,stu[i].sub.english);
}
}
if(a==2)
{
scanf("%d\n",k);
for(i=0;i<77;i++)
{
if(stu[i].number==k)
printf("%s\t%s\t%ld\t%d\t%d\t%d\t",stu[i].name,stu[i].sex,stu[i].number,stu[i].sub.math,stu[i].sub.c,stu[i].sub.english);
}
}
if(a!=(1||2))
printf("***********Error,Sign Out**************\n");
}
void Summation()
{
int a,b,j,k,i,sum,sum1,sum2,sum3;
printf("********Personal(1)*********\n");
printf("********Subject(2)********\n");
scanf("%d\n",a);
if(a==1)
{
printf("*********Please Input Serial Number**********\n");
scanf("%d",i);
sum=(stu[i].sub.math+stu[i].sub.c+stu[i].sub.english);
printf("%s,%d\n",stu[i].name,sum);
}
if(a==2)
{
printf("*********math(1)***********\n");
printf("*********c(2)***********\n");
printf("*********english(3)***********\n");
scanf("%d\n",b);
if(b==1)
{
for(j=0;j<77;j++)
sum1=sum+stu[i].sub.math;
printf("math of sum=%d\n",sum);
}
if(b==2)
{
for(j=0;j<77;j++)
sum2=sum+stu[i].sub.c;
printf("c of sum=%d\n",sum);
}
if(b==3)
{
for(j=0;j<77;j++)
sum3=sum+stu[i].sub.english;
printf("english of sum=%d\n",sum);
}
}
if(a!=(1||2))
printf("***********Error,Sign Out**************\n");
}
void Average()
{
int a,b,j,k,i,sum,sum1,sum2,sum3;
float average,average1,average2,average3;
printf("********Personal(1)*********\n");
printf("********Subject(2)********\n");
scanf("%d\n",a);
if(a==1)
{
printf("*********Please Input Serial Number**********\n");
scanf("%d",i);
sum=(stu[i].sub.math+stu[i].sub.c+stu[i].sub.english);
average=(sum/3);
printf("%s,%f\n",stu[i].name,average);
}
if(a==2)
{
printf("*********math(1)***********\n");
printf("*********c(2)***********\n");
printf("*********english(3)***********\n");
scanf("%d\n",b);
if(b==1)
{
for(j=0;j<77;j++)
sum1=sum+stu[i].sub.math;
average1=(sum1/3);
printf("math of average=%f\n",average1);
}
if(b==2)
{
for(j=0;j<77;j++)
sum2=sum+stu[i].sub.c;
average2=(sum2/3);
printf("c of average=%f\n",average2);
}
if(b==3)
{
for(j=0;j<77;j++)
sum3=sum+stu[i].sub.english;
average3=(sum3/3);
printf("english of average=%f\n",average3);
}
}
if(a!=(1||2))
printf("***********Error,Sign Out**************\n");
}
main()
{
int i,j;
i=1;
printf("welcome to\n");
printf("***********Input(1)***********\n");
printf("***********Output(2)***********\n");
printf("***********Find Information(3)***********\n");
printf("***********Scroe Summation(4)***********\n");
printf("***********Score Average(5)***********\n");
printf("***********Sign Out(6)*************\n");
printf("**Be Careful:You Must First Input**\n");
while(i!=0)
{
scanf("%d\n",j);
switch(j)
{
case 1: Input();printf("**********complete************\n");break;
case 2: Output();printf("**********complete************\n");break;
case 3: Information();printf("**********complete************\n");break;
case 4: Summation();printf("**********complete************\n");break;
case 5: Average();printf("**********complete************\n");break;
case 6: printf("**********Thank You To Use************\n");return 0;
}
}
}
vs2010总出现错误 25 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int c:\users\acer\documents\visual studio 2010\projects\yk\yk\yk.cpp 163 1 yk