忘了拷贝pdf题目,就把我还记得的题放上来吧!
wq=0
for year in range(2001,2022):
## print(year)
for month in range(1,13):
## print(str(year)+str(month))
if month in [1,3,5,7,8,10,12]:
print(str(year)+"年,"+str(month)+"月,31天")
for d in range(1,32):
liebiao = list(str(year)+str(month)+str(d))
a=0
for i in liebiao:
a+=int(i)
if a in[4,9,16,25,36,49,64]:
print(a)
wq+=1
if month in [4,6,9,11]:
print(str(year)+"年,"+str(month)+"月,30天")
for d in range(1,31):
liebiao = list(str(year)+str(month)+str(d))
a=0
for i in liebiao:
a+=int(i)
if a in[4,9,16,25,36,49,64]:
print(a)
wq+=1
if month ==2 :
if year in [2004,2008,2012,2016,2020]:
print(str(year)+"年,"+str(month)+"月,29天")
for d in range(1,30):
liebiao = list(str(year)+str(month)+str(d))
a=0
for i in liebiao:
a+=int(i)
if a in[4,9,16,25,36,49,64]:
print(a)
wq+=1
else:
print(str(year)+"年,"+str(month)+"月,28天")
for d in range(1,29):
liebiao = list(str(year)+str(month)+str(d))
a=0
for i in liebiao:
a+=int(i)
if a in[4,9,16,25,36,49,64]:
print(a)
wq+=1
print(wq)
asknum = int(input())
qishi=[]
jieshu=[]
quanbu=[]
for i in range(1,asknum+1):
zong = input().split(" ")
quanbu.append(int(zong[0]))
quanbu.append(int(zong[1]))
qishi.append(int(zong[0]))
jieshu.append(int(zong[1]))
maxnum = int(max(quanbu))
a =0
cishu=0
for i in range(1,maxnum+1):
cishu = i
a+=i
if a>=maxnum:
break
shulie = []
for i in range(1,cishu+1):
for a in range(1,i+1):
shulie.append(a)
for i in range(asknum):
sum = 0
for f in range(int(qishi[i]),int(jieshu[i])+1):
sum +=shulie[f-1]
print(sum)
sum = 0
zong = input().split()
N=int(zong[0])
K=int(zong[1])
sum = 0
for i in range(1,N+1):
flag=0
for a in str(bin(i)).replace('0b',''):
if a in ['1']:
flag+=1
if flag == K:
sum+=1
print(sum)
long = int(input())
shulie = input().split(" ")
zong = 0
for i in range(long):
for a in range(i,long):
chengji=1
qiuhe = 0
for b in range(i,a+1):
qiuhe += int(shulie[b])
chengji *= int(shulie[b])
if qiuhe == chengji:
zong+=1
chengji=1
qiuhe = 0
print(zong)
s = input()
for i in s:
if ord(i) >=97 and ord(i) <=122:
print(chr(int(ord(i))-32),end="")
else:
print(i,end="")
总体感觉国赛试题比省赛简单,由于个人编程水平有限,代码仅供参考!
最后证书镇楼哈哈!