nomer3
program ab;
uses crt
uses sysutils;
var s,s1: string;
i,j: integer;
begin
clrscr;
write('введите строку слово');
writeln;
readln(s);
for i: =1 to length(s) do
for j: =1 to length(s) do
if (s[i]=s[j]) and(i< > j)
then
if pos(s[i], s1)=0
then s1: =s1+s[i]+' ';
write('повторяющиеся символы: ', s1);
readln;
end.
nomer2
program as
uses crt;
var s,sp: string;
i: integer;
write('s=');
sp: ='';
sp: =s[i]+sp;
if sp=s then writeln ('палиндром')
else writeln ('не палиндром');
readkey
nomer1
function compare(s1,s2: string): boolean;
result: =s1=s2;
end;
var s1,s2: string;
readln(s1);
readln(s2);
if compare(s1,s2) then write('yes')
else write('no')
F - Результат функции
1)
Х1 Х2 Х3 Х4 F
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
2)
0 0 0 0 1
0 0 0 1 1
0 0 1 0 1
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
nomer3
program ab;
uses crt
uses sysutils;
var s,s1: string;
i,j: integer;
begin
clrscr;
write('введите строку слово');
writeln;
readln(s);
for i: =1 to length(s) do
for j: =1 to length(s) do
if (s[i]=s[j]) and(i< > j)
then
if pos(s[i], s1)=0
then s1: =s1+s[i]+' ';
write('повторяющиеся символы: ', s1);
readln;
end.
nomer2
program as
uses crt;
var s,sp: string;
i: integer;
begin
clrscr;
write('s=');
readln(s);
sp: ='';
for i: =1 to length(s) do
sp: =s[i]+sp;
if sp=s then writeln ('палиндром')
else writeln ('не палиндром');
readkey
end.
nomer1
function compare(s1,s2: string): boolean;
begin
result: =s1=s2;
end;
var s1,s2: string;
begin
readln(s1);
readln(s2);
if compare(s1,s2) then write('yes')
else write('no')
end.
F - Результат функции
1)
Х1 Х2 Х3 Х4 F
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 0
1 1 1 1 0
2)
Х1 Х2 Х3 Х4 F
0 0 0 0 1
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1