// 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.
#
# https://pastebin.com/Nasemc0T
# Python 3.x
# 1.
# Для теста возьмем конкретную матрицу 8x8.
matrix=[[-35, 115, -45, -25, 1, 83, 13, 53], [119, 128, 31, 124, 66, 126, 63, -1], [-21, 86, 120, 68, 149, 65, -42, 107], [108, 112, 96, 25, 99, 9, 140, 89], [51, 99, 68, 80, 26, 74, 105, -6], [92, 82, 22, 54, 11, 87, -2, -42], [26, -21, 129, 85, 97, 101, 106, 96], [10, -7, -28, 96, 115, 57, -25, 77]]
# Эквивалентно .flatten() для numpy матрицы.
array=list()
for row in matrix: array=array + row
maximum=max(array)
print("#1. Maximum: ", maximum)
# 2.
file="test.txt"
with open(file) as fp:
amount=int(fp.readline())
for _ in range(amount):
digit=int(fp.readline())
array.append(digit)
# конец двойно табуляции
print("#2. Maximum: ", maximum)
// 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.
#
# https://pastebin.com/Nasemc0T
#
# Python 3.x
# 1.
# Для теста возьмем конкретную матрицу 8x8.
matrix=[[-35, 115, -45, -25, 1, 83, 13, 53], [119, 128, 31, 124, 66, 126, 63, -1], [-21, 86, 120, 68, 149, 65, -42, 107], [108, 112, 96, 25, 99, 9, 140, 89], [51, 99, 68, 80, 26, 74, 105, -6], [92, 82, 22, 54, 11, 87, -2, -42], [26, -21, 129, 85, 97, 101, 106, 96], [10, -7, -28, 96, 115, 57, -25, 77]]
# Эквивалентно .flatten() для numpy матрицы.
array=list()
for row in matrix: array=array + row
maximum=max(array)
print("#1. Maximum: ", maximum)
# 2.
file="test.txt"
with open(file) as fp:
amount=int(fp.readline())
array=list()
for _ in range(amount):
digit=int(fp.readline())
array.append(digit)
# конец двойно табуляции
maximum=max(array)
print("#2. Maximum: ", maximum)