初学者请教简单问题
pascal吧
全部回复
仅看楼主
level 1
曼莎诗祺 楼主
program l(input,output);
var
b:integer;
a:integer;
begin
for a:=1 to 10 do;
begin
a:=a+1;
readln(b);
if b=7 then writeln('ok')
else writeln('no');
end;
readln;
end.
如上代码。编译环境:XP,free pascal 2.6.0。
如下问题:只能循环一次,请教一下什么原因
2014年01月04日 12点01分 1
level 11
a是循环的有序变量,不能拿来做循环体内变量
2014年01月04日 13点01分 2
可是为什么我改成其他字母也是不能循环呢?[疑问]
2014年01月05日 03点01分
level 13
for a:=1 to10 do
这错了,你重新把a换成其他字母,重新定义,我也初学,你多大?
2014年01月05日 03点01分 3
我十四岁诶
2014年01月05日 04点01分
回复 曼莎诗祺 :我十二,留下企鹅,交流切磋怎样
2014年01月05日 04点01分
回复 谁伴我闯荡的20 :嗯哼,80383576
2014年01月05日 04点01分
我才11岁,己经学了一年了……
2014年01月15日 09点01分
level 13
Do 后的;去掉,上面的不能解决根本问题。
2014年01月05日 05点01分 4
+1
2014年01月06日 04点01分
thank you!
2014年01月14日 06点01分
经典[呵呵]
2014年02月10日 01点02分
level 10
去掉do的分号,在第六行
2014年01月05日 10点01分 5
level 5
’do‘后面的‘;’去掉
不然‘;'算一个空语句
。。。。。
。。。。。
。。。。。
2014年01月06日 04点01分 6
level 5
金钱诚可贵,节操价更高。
但若为人品,两者皆可抛。
2014年01月06日 04点01分 7
level 13
仔细看第六行
2014年02月10日 02点02分 12
1