// PascalABC.Net
var vowel: set of char = ['а', 'у', 'о', 'ы', 'и', 'э', 'я', 'ю', 'ё', 'е'];
s, substr: string;
begin
s := 'кот в сапогах';
var words := s.Split(' ');
for var i := 0 to words.length - 1 do
for var j := 1 to words[i].Length do
if words[i][j] in vowel then
substr := Copy(words[i], 1, j-1);
Delete(words[i], 1, j-1);
words[i] += substr;
break;
end;
words[i] += 'циус';
writeln(words.JoinIntoString(' '));
end.
INP = input().split(' ')
data=[]
search_for=0
for i in range(int(INP[0])-1):
data.append([])
data[i]=(input().split(' '))
ask = input().split(' ')
for i in range(len(ask)):
if int(ask[i]) == 1:
print(1)
else:
# Search job
for j in range(len(data)):
if int(data[j][1]) == int(ask[i]):
search_for = int(data[j][0])
break
# Count
k=0
if int(data[j][0]) == search_for:
k+=1
print(k)
Объяснение:
// PascalABC.Net
var vowel: set of char = ['а', 'у', 'о', 'ы', 'и', 'э', 'я', 'ю', 'ё', 'е'];
s, substr: string;
begin
s := 'кот в сапогах';
var words := s.Split(' ');
for var i := 0 to words.length - 1 do
begin
for var j := 1 to words[i].Length do
if words[i][j] in vowel then
begin
substr := Copy(words[i], 1, j-1);
Delete(words[i], 1, j-1);
words[i] += substr;
break;
end;
words[i] += 'циус';
end;
writeln(words.JoinIntoString(' '));
end.
INP = input().split(' ')
data=[]
search_for=0
for i in range(int(INP[0])-1):
data.append([])
data[i]=(input().split(' '))
ask = input().split(' ')
for i in range(len(ask)):
if int(ask[i]) == 1:
print(1)
else:
# Search job
for j in range(len(data)):
if int(data[j][1]) == int(ask[i]):
search_for = int(data[j][0])
break
# Count
k=0
for j in range(len(data)):
if int(data[j][0]) == search_for:
k+=1
print(k)
Объяснение: