def isyun(n): if n%100==0: if n%400==0: return 1 else: if n%4==0: return 1 n=int(input()) dicy={1:31,2:29,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31} dicp={1:31,2:28,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31} days=(n-1)*365 for i in range(n): if isyun(i): days+=1 if isyun(n)==1: s=0 ls=[] for i in range(1,13): lt=[] for j in range(1,i): lt.append(dicy[j]) ls.append(sum(lt)+13) for i in ls: if (i+days+6)%7==5: s+=1 print(s) else: s=0 ls=[] for i in range(1,13): lt=[] for j in range(1,i): lt.append(dicp[j]) ls.append(sum(lt)+13) for i in ls: if (i+days+6)%7==5: s+=1 print(s)
0.0分
0 人评分
1268:P1001浏览:644 |
人见人爱A+B (C++代码)浏览:1069 |
C二级辅导-公约公倍 (C语言代码)浏览:2158 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:643 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:543 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:724 |
C语言程序设计教程(第三版)课后习题5.7 (Java代码)浏览:910 |
三角形 (C++代码)记忆化搜索浏览:1317 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:769 |
1157题解浏览:769 |