Pascal 中带有逻辑运算符(< > = 等)的 Case 语句
我在做这项工作时遇到了麻烦。显然,我不能使用 >或<在 case 语句中,有解决方法吗?谢谢!
case num of
0:
begin
cont_0 := cont_0 + 1;
end;
> 0:
begin
cont_pos := cont_pos + 1;
sum_pos := sum_pos + num;
end;
< 0:
begin
sum_neg := sum_neg + num;
end;
else;
end;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
比
if ... else if ... else
更具可读性?你决定。More readable than
if ... else if ... else
? You decide.那么不使用case,为什么不使用if呢?
Don't use case then, why not use if?