pascal :got "boolean" expected "longint"var n,p,q,i,k,j:longint;t2:boolean; t1:boolean ;beginreadln(n);p:=1;repeatp:=p+1;q:=n-p;t1:=true;for i:=2 to trunc(sqrt(p)) doif p mod j=0 then begin t1:=false; k:=k+1;end;t2:=true;for i:=2 to trunc(sqrt(q)) do

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 23:06:29

pascal :got "boolean" expected "longint"var n,p,q,i,k,j:longint;t2:boolean; t1:boolean ;beginreadln(n);p:=1;repeatp:=p+1;q:=n-p;t1:=true;for i:=2 to trunc(sqrt(p)) doif p mod j=0 then begin t1:=false; k:=k+1;end;t2:=true;for i:=2 to trunc(sqrt(q)) do
pascal :got "boolean" expected "longint"
var n,p,q,i,k,j:longint;t2:boolean; t1:boolean ;
begin
readln(n);
p:=1;
repeat
p:=p+1;
q:=n-p;
t1:=true;
for i:=2 to trunc(sqrt(p)) do
if p mod j=0 then begin t1:=false; k:=k+1;end;
t2:=true;
for i:=2 to trunc(sqrt(q)) do
if q mod j=0 then t2:=false;
until t1 and t2 and k=n;
writeln(n,':=',p,'+',q);
end.

pascal :got "boolean" expected "longint"var n,p,q,i,k,j:longint;t2:boolean; t1:boolean ;beginreadln(n);p:=1;repeatp:=p+1;q:=n-p;t1:=true;for i:=2 to trunc(sqrt(p)) doif p mod j=0 then begin t1:=false; k:=k+1;end;t2:=true;for i:=2 to trunc(sqrt(q)) do
倒数第二行t1 and t2 and k=n 错了
改为 t1 and t2 and (k=n);
不然t2会和k比较,boolean 不能和int比较

pascal :got boolean expected longintvar n,p,q,i,k,j:longint;t2:boolean; t1:boolean ;beginreadln(n);p:=1;repeatp:=p+1;q:=n-p;t1:=true;for i:=2 to trunc(sqrt(p)) doif p mod j=0 then begin t1:=false; k:=k+1;end;t2:=true;for i:=2 to trunc(sqrt(q)) do map:array ['A'...'z','A'...'z'] of boolean 在pascal中,这样定义的,怎么用?举例说明 pascal中的 Incompatible types:got Double expected Smallint 求出所有的既是回文数又是素数的三位数.pascal求大神求解哪里错了?最近刚刚学的pascal有个题目自己手打可是错了.var h,h1:integer;yes:boolean;proceduresub(x:integer; var yy:boolean);var k,n:integer;beginfor k:= 1t pascal pascal pascal! pascal 判断下列赋值语句题和计算1、判断下列赋值语句是否正确.var a,b,c:integer;d:real;e:boolean;⑴ d:=a mod b;⑵ e:= b div 2;⑶ e:=a Pascal语言翻译标准常量 False Maxint True标准类型 Boolean Char Real Integer标准函数 Abs Arctan Chr Cos Eof Eoln Exp Ln Odd Ord Pred Round Sin Sqr Sqrt Succ Trunc标准过程 Dispose Get New Pack boolean operations是什么意思 Boolean operation是什么意思 Boolean literal是什么意思 boolean holidays[][]啥意思 Turbo Pascal编程问题1、下列变量说明中,不合法的是( ).A、var fh:char; B、var r:real; C、var a=boolean; D、var name:string2、下列( )是整型的类型标识符A、sqrt B、integer C、string D、real3、sl:=-22div pascal问题(改错)一个自然数是素数,且它的数字位置经过任意对换后仍为素数,称为绝对素数.例如13.试找出所有这样的二位绝对素数.vari,a,b,x,j,k:longint; bz:boolean;beginfor i:=10 to 54 dobeginbz:=false;fo 帮忙看看哪错了(pascal)(数学黑洞6174 已知:一个任意的四位正整数.将数字重新组合成一个最vara :array[1..4]of integer;max4,max3,max2,max1,m,i,j,k:integer;flag:boolean;cha:longint;beginread(a[1],a[2],a[3],a[4]);flag Pascal数组的练习题两道,2`.var a:array['A'..'E',1..4,boolean]of real,则a['A',3]是( )A.一个实型的数组元素B.一个数组,该数组具有两个实型数组元素C.一个数组,该SHUZU JUYOU 4*2个实型数组元素D.一个数组, Pascal 是什么 Pascal是什么 pascal随机数