PASCAL如何表达数字区间范围
pascal吧
全部回复
仅看楼主
level 6
Jovel- 楼主
比如说case语句.有好多数要表达.怎么直接用类似于 0-100之类的代表?求解
2014年01月21日 12点01分 1
level 13
集合
x in [0..100]
范围0..255
2014年01月22日 10点01分 2
level 11
{example}
case a of
1..10:write('0');
11..20:write('1');
21..30:write('2');
end;
2014年01月25日 13点01分 3
非常感谢!
2014年02月01日 09点02分
+1
2014年02月08日 03点02分
level 9
子界没学好啊。
2014年02月01日 21点02分 4
层主我想问下子界型的内存占用量是多少?
2014年02月04日 15点02分
比如说 var a:byte;{0..255} 占用1个存储空间,var a:integer;{-32768..32767} 占用两个存储空间;那么 var a:0..99又占用多少存储空间?0..256?
2014年02月05日 07点02分
回复 千方残光剑41 :这个取决于编译器吧,你可以watch一下。一般来说有多少个变量就是占多少空间,当然你可以用packed array。
2014年02月06日 00点02分
level 13
n in [0..100]
2014年02月10日 02点02分 5
1