我的PASCAL编程哪错了

来源:百度知道 编辑:UC知道 时间:2024/05/27 18:19:15
program no1;
var a,c,d,b:integer;
c:boolean;
begin
b:=0;
repeat
inc(b);
a:=b mod 3;
b:=b mod 4;
c:=b mod 5;
d:=b mod 7;
if a=1 and b=1 and c=1 and d=2
then c:=ture;
until c=ture;
writeln(b);
readln
end.
求出一个最小的正整数能除以3.4.5余1 除以7余2的

首先不能一个变量名定义两个变量类型。。。
看你的c,第二行整形,第三行又定义了布尔型,报错
and之间要加括号
而且b在循环中被更改。。。陷入死循环
program no1;
var
a,c,d,b,bb:integer;
cc:boolean;
begin
b:=0;
repeat
inc(b);
if (b mod 3=1)and(b mod 4=1)and(b mod 5=1)and( b mod 7=2)
then cc:=true;
until cc=true;
writeln(b);
readln
end.

我才学,不确保对。
program no1;
var a,c,d,b:integer;
c:boolean;
begin
b:=0;
repeat
inc(b);
a:=b mod 3;
b:=b mod 4;
c:=b mod 5;
d:=b mod 7;
if a=1 and b=1 and c=1 and d=2 then writeln(c);
else c :=fasle
until c=ture;
writeln(b);
readln
end.

变量c重复我改成o and后加括号 真的值不是ture是true
改完后如下::
program no1;
var a,c,d,b:integer;
o:boolean;
begin
b:=0;
repeat
inc(b);
a:=b mod 3;
b:=b mod 4;
c:=b mod 5;
d:=b mod 7; <