Program Pr1; uses crt; var stroka:string; i,k,x:integer; mas:array[byte] of integer; Begin clrscr; readln(stroka);
i:=1; repeat
val(stroka[i],k,x); mas[i]:=k; i:=i+1;
until i=length(stroka); x:=0; for i:=1 to length(stroka) do x:=x+mas[i]; if x=10 then writeln('TRUE') else writeln('ELSE'); end.
2 я не знаю как решать
3)
Program Pr1; uses crt; var stroka:string; i,k,x:integer; mas:array[byte] of integer; begin clrscr; readln(stroka); i:=1; while i<=length(stroka) do begin val(stroka[i],k,x); mas[i]:=k; i:=i+1; end; x:=0; for i:=1 to length(stroka) do x:=x+mas[i]; writeln(x); end.
4)
Program Pr1; uses crt; var stroka:string; i,k,x:integer; mas:array[byte] of integer; begin clrscr; readln(stroka); i:=1; while i<=length(stroka) do begin val(stroka[i],k,x); mas[i]:=k; i:=i+1; end; x:=0; for i:=1 to length(stroka)-1 do for k:=1 to length(stroka)-i do if mas[k]=mas[k+1] then x:=x+1; if x>0 then writeln('TRUE') else writeln('FALSE'); end.
Program Pr1; uses crt; var mas:array[100..999] of integer; i:integer; Begin clrscr; for i:=100 to 999 do mas[i]:=i; {1 sposob} for i:=100 to 999 do if mas[i] mod 9 =0 then writeln(mas[i]); i:=100; {2 sposob} while i<=999 do begin if mas[i] mod 9=0 then writeln(mas[i]); i:=i+1; end; i:=100; {3 sposob} repeat if mas[i] mod 9=0 then writeln(mas[i]); i:=i+1 until i=999 end.
2)
Program Pr1; uses crt; var mas:array[100..999] of integer; i,v:integer; Begin clrscr; v:=0; for i:=100 to 999 do mas[i]:=i; {1 sposob} for i:=100 to 999 do if mas[i] mod 17 =0 then v:=v+mas[i]; writeln(v); i:=100; {2 sposob} v:=0; while i<=999 do begin if mas[i] mod 17=0 then v:=v+mas[i];; i:=i+1; end; writeln(v); i:=100; {3 sposob} v:=0; repeat if mas[i] mod 17=0 then v:=v+mas[i]; i:=i+1 until i=999; writeln(v); end.
а я разве их не решал
но ладнооо
1)
Program Pr1;
uses crt;
var stroka:string;
i,k,x:integer;
mas:array[byte] of integer;
Begin
clrscr;
readln(stroka);
i:=1;
repeat
val(stroka[i],k,x);
mas[i]:=k;
i:=i+1;
until i=length(stroka);
x:=0;
for i:=1 to length(stroka) do x:=x+mas[i];
if x=10 then writeln('TRUE')
else writeln('ELSE');
end.
2 я не знаю как решать
3)
Program Pr1;
uses crt;
var stroka:string;
i,k,x:integer;
mas:array[byte] of integer;
begin
clrscr;
readln(stroka);
i:=1;
while i<=length(stroka) do begin
val(stroka[i],k,x);
mas[i]:=k;
i:=i+1;
end;
x:=0;
for i:=1 to length(stroka) do x:=x+mas[i];
writeln(x);
end.
4)
Program Pr1;
uses crt;
var stroka:string;
i,k,x:integer;
mas:array[byte] of integer;
begin
clrscr;
readln(stroka);
i:=1;
while i<=length(stroka) do begin
val(stroka[i],k,x);
mas[i]:=k;
i:=i+1;
end;
x:=0;
for i:=1 to length(stroka)-1 do
for k:=1 to length(stroka)-i do if mas[k]=mas[k+1] then x:=x+1;
if x>0 then writeln('TRUE')
else writeln('FALSE');
end.
1)
Program Pr1;
uses crt;
var mas:array[100..999] of integer;
i:integer;
Begin
clrscr;
for i:=100 to 999 do mas[i]:=i; {1 sposob}
for i:=100 to 999 do if mas[i] mod 9 =0 then writeln(mas[i]);
i:=100; {2 sposob}
while i<=999 do begin
if mas[i] mod 9=0 then writeln(mas[i]);
i:=i+1;
end;
i:=100; {3 sposob}
repeat
if mas[i] mod 9=0 then writeln(mas[i]);
i:=i+1
until i=999
end.
2)
Program Pr1;
uses crt;
var mas:array[100..999] of integer;
i,v:integer;
Begin
clrscr;
v:=0;
for i:=100 to 999 do mas[i]:=i; {1 sposob}
for i:=100 to 999 do if mas[i] mod 17 =0 then v:=v+mas[i];
writeln(v);
i:=100; {2 sposob}
v:=0;
while i<=999 do begin
if mas[i] mod 17=0 then v:=v+mas[i];;
i:=i+1;
end;
writeln(v);
i:=100; {3 sposob}
v:=0;
repeat
if mas[i] mod 17=0 then v:=v+mas[i];
i:=i+1
until i=999;
writeln(v);
end.