佳能三码合一:运行出现 scanf:floatting point formats not linked Abnormal program termination

来源:百度文库 编辑:高考问答 时间:2024/05/04 17:42:06
#include "stdio.h"
main()
{ int i;
struct subject{
float chinese;
float math;
float english;
};

struct study{
char name[10];
struct subject one;
} S[2];

for(i=0; i<2; i++){
scanf("%s",S[i].name);
scanf("%f",&S[i].one.chinese,&S[i].one.math,&S[i].one.english);

}

for(i=0; i<2; i++){
printf("%s\n",S[i].name) ;
printf("Chinese: %f\n",S[i].one.chinese);
printf("Math: %f\n",S[i].one.math) ;
printf("English: %f\n\n",S[i].one.english);

}
}
第2个scanf 有3个%f,我写掉了!各位大虾们啊,我新学C语言,帮个忙啊,指出错误,谢了啊!!!

scanf("%f",&S[i].one.chinese,&S[i].one.math,&S[i].one.english); ???
语句问题!自己清楚!

开头改成:
void main()
这样在VC中就不用加返回值了

程序我调过了,没有问题!