答案 0 :(得分:2)
我的猜测是数据类型错误。它正在将学生ID打印为浮点数(例如5.6或1.44E09),但基础数据不是浮点数。例如:
int student = 53;
printf ( "Student ID = %f\n", student ); // WRONG
学生编号是一个整数“ int”,但是在打印指令(在此示例中)中,它告诉计算机打印为浮点数(%f)。要打印int,必须使用%d:
int student = 53;
printf ( "Student ID = %d\n", student );
使用%f表示浮点数:
int student = 53;
float gradeAverage = 3.6;
printf ( "Student ID = %d grade=%f\n", student, gradeAverage);