Program kod; Var q,w,e,r,t,y,u,i,x:integer; Begin write(q,w,e,r,t,y,u,i); if q:=1 then...

0 голосов

Program kod;
Var q,w,e,r,t,y,u,i,x:integer;
Begin
write(q,w,e,r,t,y,u,i);
if q:=1 then x+(1*2*2*2*2*2*2*2);
if q:=0 then x+0;
if w:=1 then x+(1*2*2*2*2*2*2);
if w:=0 then x+0;
if e:=1 then x+(1*2*2*2*2*2);
if e:=0 then x+0;
if r:=1 then x+(1*2*2*2*2);
if r:=0 then x+0;
if t:=1 then x+(1*2*2*2);
if t:=0 then x+0;
if y:=1 then x+(1*2*2);
if y:=0 then x+0;
if u:=1 then x+(1*2);
if u:=0 then x+0;
if i:=1 then x+(1*1);
if i:=0 then x+0;
writeln('Код:'x);


В чём ошибка? Пишет Встречено ':=', а ожидался оператор


спросил от (21 баллов) в категории Информатика
1 Ответ
0 голосов
ответил от Одаренный (1.1k баллов)

:= означает "присвоить значение".
После if пишется логическое выражение, например, х>0 или х=0 (но не х:=). 
После служебного слово then  должен следовать оператор присваивания (:=), скорее всего х:=x+(1*2*2*2*2*2*2*2) и т.д.

оставил комментарий от (21 баллов)

Спасибо

оставил комментарий от (21 баллов)

Program kod; 
Var q,w,e,r,t,y,u,i,x:integer;
Begin
write(q,w,e,r,t,y,u,i);
if q:=1 then x+(1*2*2*2*2*2*2*2);
if q:=0 then x+0;
if w:=1 then x+(1*2*2*2*2*2*2);
if w:=0 then x+0;
if e:=1 then x+(1*2*2*2*2*2);
if e:=0 then x+0;
if r:=1 then x+(1*2*2*2*2);
if r:=0 then x+0;
if t:=1 then x+(1*2*2*2);
if t:=0 then x+0;
if y:=1 then x+(1*2*2);
if y:=0 then x+0;
if u:=1 then x+(1*2);
if u:=0 then x+0;
if i:=1 then x+(1*1);
if i:=0 then x+0;
writeln('Код:'x); 

оставил комментарий от (21 баллов)

а сейчас в чём проблема

оставил комментарий от (21 баллов)

ой не то

оставил комментарий от (21 баллов)

Program kod; 
Var q,w,e,r,t,y,u,i,x:integer;
Begin
write(q,w,e,r,t,y,u,i);
if q=1 then x+(1*2*2*2*2*2*2*2);
if q=0 then x+0;
if w=1 then x+(1*2*2*2*2*2*2);
if w:=0 then x+0;
if e=1 then x+(1*2*2*2*2*2);
if e=0 then x+0;
if r=1 then x+(1*2*2*2*2);
if r=0 then x+0;
if t=1 then x+(1*2*2*2);
if t=0 then x+0;
if y=1 then x+(1*2*2);
if y=0 then x+0;
if u=1 then x+(1*2);
if u=0 then x+0;
if i=1 then x+(1*1);
if i=0 then x+0;
writeln('Код:'x);

оставил комментарий от Одаренный (1.1k баллов)

После then посмотри в моем ответ, что должно быть

...