1. Заманауи робот жайлы не айта аласың? 2. Роботтың дамуы біздің тіршілігімізге қалай әсер етеді? 3. Адам мен роботтың қандай басты 3 айырмашылығын атай аласың?
Var fullstr,s,s_int,s_rl,s_str: string; int: integer; rl: real; space,err: integer; begin writeln('String:'); readln(fullstr);
while fullstr[1] = ' ' do delete(fullstr,1,1); while fullstr[length(fullstr)] = ' ' do delete(fullstr,length(fullstr),1); while pos(' ',fullstr) <> 0 do delete(fullstr,pos(' ',fullstr),1);
s_int := ''; s_rl := ''; s_str := ''; while fullstr <> '' do begin space := pos(' ',fullstr); if space = 0 then space := length(fullstr) + 1; s := copy(fullstr,1,space-1); val(s,int,err); if err = 0 then s_int := s_int + s + ' ' else begin val(s,rl,err); if err = 0 then s_rl := s_rl + s + ' ' else s_str := s_str + s + ' '; end; delete(fullstr,1,space); end;
fullstr,s,s_int,s_rl,s_str: string;
int: integer;
rl: real;
space,err: integer;
begin
writeln('String:');
readln(fullstr);
while fullstr[1] = ' ' do
delete(fullstr,1,1);
while fullstr[length(fullstr)] = ' ' do
delete(fullstr,length(fullstr),1);
while pos(' ',fullstr) <> 0 do
delete(fullstr,pos(' ',fullstr),1);
s_int := '';
s_rl := '';
s_str := '';
while fullstr <> '' do begin
space := pos(' ',fullstr);
if space = 0 then
space := length(fullstr) + 1;
s := copy(fullstr,1,space-1);
val(s,int,err);
if err = 0 then
s_int := s_int + s + ' '
else begin
val(s,rl,err);
if err = 0 then
s_rl := s_rl + s + ' '
else
s_str := s_str + s + ' ';
end;
delete(fullstr,1,space);
end;
writeln('Integers: ',s_int);
writeln('Real: ',s_rl);
writeln('Words: ',s_str);
readln
end.
a, real_coin: array[1..6] of integer;
forged_coin, i: integer;
begin
for i := 1 to 6 do
a[i] := 10;
forged_coin := random(6);
a[forged_coin] := random(4) + 8;
writeln(forged_coin);
for i := 1 to 6 do
write(a[i], ' ');
writeln;
forged_coin := 0;
if a[1] + a[2] = a[3] + a[4] then begin
real_coin[1] := a[1];
real_coin[2] := a[2];
if real_coin[1] = a[5] then
forged_coin := 6
else forged_coin := 5;
end
else begin
real_coin[1] := a[5];
real_coin[2] := a[6];
if a[1] + a[2] = real_coin[1] + real_coin[2] then begin
real_coin[3] := a[1];
real_coin[4] := a[2];
if real_coin[1] = a[3] then
forged_coin := 4
else forged_coin := 3;
end
else begin
real_coin[3] := a[3];
real_coin[4] := a[4];
if real_coin[1] = a[1] then
forged_coin := 2
else forged_coin := 1;
end;
end;
writeln(forged_coin);
end.