Answer the question
In order to leave comments, you need to log in
How to count weekdays?
Training practice for students of the specialty "Information systems in management" in DonSTU starts on the k-th of June and lasts for 3 weeks. Entrance exams in DonSTU begin on July 1. How many days of study practice in a given year coincide with the entrance exams (consider working days only)?
It is necessary to build a flowchart for this task, how to calculate weekdays
k = int(input("Число: "))
g = int(input("Год: "))
i = 0
l = 21 # счетчик недель практики
f = 31 - k # оставшиеся кол-во дней до конца месяца
if k >=10:
print("Дней практики в июле: " + str(l - f))
a = 0 #(14 - 6)/12
y = g - a
m = 12 #6+12*a-2
dnd = ((1 + y + y // 4 - y // 100 + y // 400 + (31* 7+12 * 0 - 2)) % 7) # 1 июля
print(str(dnd) + " день недели")
while dnd != 0 or l == 0 or dnd != 6:
i += 1 # счетчик дней
if dnd >= 5:
dnd = 0
l = l - 2
else:
dnd += 1
l = l - 1
r = (l / 7) * 5
v = (l - r) - 1
i = i + r + v
print("Совпадающих дней: " + str(i))
else:
print("Общих дней нет")
a = (14 − месяц) / 12 # 0
y = год − a # y
m = месяц + 12 * a − 2 # 7+ 12 * 0 - 2
ДеньНедели = (день + y + y / 4 − y / 100 + y / 400 + (31 * m) / 12) ОСТАТОК 7
y = int(input())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question