count_6 = 0
count_2 = 0
while True:
s = input()
if s == 'стоп':
break
for c in s:
if c == '6':
count_6 += 1
elif c == '2':
count_2 += 1
print("Кількість цифр 6:", count_6)
print("Кількість цифр 2:", count_2)
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
count_6 = 0
count_2 = 0
while True:
s = input()
if s == 'стоп':
break
for c in s:
if c == '6':
count_6 += 1
elif c == '2':
count_2 += 1
print("Кількість цифр 6:", count_6)
print("Кількість цифр 2:", count_2)