Дамп всех задач

This commit is contained in:
2017-05-22 13:29:43 +03:00
parent b970626fef
commit 93746b05d7
173 changed files with 2505 additions and 0 deletions

15
str/1.py Normal file
View File

@@ -0,0 +1,15 @@
def clean(s, ss):
g = ''
for ch in s:
if (ss.find(ch)!=-1):
g += ch
gg = ''
for ch in ss:
if (s.find(ch)!=-1):
gg+=ch
g = g.replace(' ','')
gg = gg.replace(' ','')
return g, gg
s1, s2 = clean(input(), input())
print(s1)
print(s2)

8
str/Program2.pas Normal file
View File

@@ -0,0 +1,8 @@
var
a: int64;
s: string;
begin
ReadLn(s);
write(s[3], ' ', s[s.Length], ' ', s[s.Length], ' ');
end.

8
str/Program3.pas Normal file
View File

@@ -0,0 +1,8 @@
var
a: int64;
s: string;
begin
ReadLn(s);
if (s[1] = s[s.Length]) then write('<27><>') else write('<27><><EFBFBD>');
end.

8
str/Program4.pas Normal file
View File

@@ -0,0 +1,8 @@
var
a: int64;
s: string;
begin
ReadLn(s);
write(s[3], s[s.Length]);
end.

15
str/Program5.pas Normal file
View File

@@ -0,0 +1,15 @@
var
a, m: int64;
s: string;
f: char;
begin
ReadLn(s);
Readln(f);
m := 0;
for a := 1 to s.Length do
begin
if (s[a] = f) then m := m + 1;
end;
write(m);
end.

17
str/Program6.pas Normal file
View File

@@ -0,0 +1,17 @@
var
a, m: int64;
s: string;
begin
ReadLn(s);
m := 0;
for a := 2 to s.Length do
begin
if (string(s[a - 1] + s[a]) = '<27><>') then
begin
s[a - 1] := '<27>';
s[a] := '<27>';
end;
end;
write(s);
end.