写出float x 与“零值”比较的if语句. 答: if(x>0.000001&&x<-0.000001);
【attention】不可将浮点变量用"=="或"!="与任何数进行比较. 根据学生分数来显示学生信息 #include <stdio.h>
#define EPSINON 1e-6 //允许的误差
typedef struct student
{
int id;
char name[20];
float score;
}Student;
int search(Student *p ,int n ,float key);
int main(int argc,char *argv[])
{
Student stu[4] = {
......
阅读全文