Здесь Вы можете найти ответы на многие вопросы или задать свой вопрос!
Python 3.7.2
def readFile(file):
with open(file, 'r', encoding = 'utf-8') as file:
text = file.readlines()
return text
file = input('Enter path to file: ')
text = ' '.join(readFile(file))
most_word = ['', 0]
for word in text.split(' '):
if most_word[1] < text.count(word):
most_word[0] = word; most_word[1] = text.count(word)
print(most_word)
составим уравнение:
x- первая корзина
y- вторая корзина
x+54=x+y
x-x+54=y
y=54 - (во второй корзине)
x=54+38
x=92
z- третья корзина
z=x-27
z=92-27
z=65
ответ: в третей корзине 65 орехов
var
i,j,k: integer;
s,p: string;
begin
p: ='abcdefghijklmnopqrstuvwxyzабвгдеёжзийклмнопрстуфхцчшщъыьэюя';
readln(s);
k: =0;
for i: =1 to length(s) do
for j: =1 to length(p) do
if s[i]=p[j] then k: =k+1;
writeln(k);
end.
Популярные вопросы