标签:+= 题目 == lazy int 描述 src ccf png
题目描述:
题目描述:
n = int(input())
a = [0] * 4 #完成4个人
m = 0
i = 0
while i < (n + m):
i += 1
if (i % 7 == 0) or (str(7) in list(str(i))):
a[i % 4 - 1] += 1
m += 1
for i in a:
print(i)
# CCF201912-1 报数
n = int(input())
num = 1;
count = 1;
cnt=[0, 0, 0, 0]
while count <= n:
if num % 7 == 0 or ‘7‘ in str(num):
cnt[(num - 1) % 4] += 1
else:
count += 1
num += 1
for i in range(4):
print(cnt[i])
n=int(input())
i=1
count=1
a=[0,0,0,0]
while(count<=n):
if("7" in str(i) or i%7==0):
if(i%4==1):
a[0]+=1
elif(i%4==2):
a[1]+=1
elif(i%4==3):
a[2]+=1
elif(i%4==0):
a[3]+=1
else:
count+=1
i+=1
for j in range(4):
print(a[j])
标签:+= 题目 == lazy int 描述 src ccf png
原文地址:https://www.cnblogs.com/waterxx/p/13294371.html