📄 compare.c
字号:
int Compare(RecUnion * x, RecUnion * y, int typeX, int typeY)
{
if (typeX != typeY)
{
puts(" 输入条件错误,类型不符,不能进行比较");
return ERROR;
}
switch (typeX) {
case Int:
if (x->intType - y->intType == 0)
return EQ;
else if (x->intType - y->intType > 0)
return GT;
else
return LT;
case Float:
if ((x->floatType - y->floatType <= 0.00001) && (x->floatType - y->floatType >= -0.00001))
return EQ;
else if (x->floatType - y->floatType > 0.00001)
return GT;
else
return LT;
case String:
if (strcmpi(x->string, y->string) == 0)
return EQ;
else if (strcmpi(x->string, y->string) > 0)
return GT;
else
return LT;
}
return ERROR;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -