简单易于理解的天数问题——Python 摘要:a,b,c=map(int,input().strip().split())m=[31,28,31,30,31,30,31,…… 题解列表 2025年01月16日 1 点赞 0 评论 480 浏览 评分:10.0
1049: [编程入门]结构体之时间设计(python) ~~~pythondefis_lun(y):ify%100==0:ify%400==0:returnTrueelse:returnFalseelse:ify%4==0:returnTrueelse:returnFalsea=[0,31,59, 题解列表 2024年10月24日 1 点赞 0 评论 490 浏览 评分:0.0
简单易懂,结构体之时间设计 摘要:解题思路:平年2月28天,闰年2月29天,平年闰年分开考虑注意事项: 无参考代码:y, m, d = map(int, input().split()) day_num = d year1 = […… 题解列表 2024年05月04日 2 点赞 0 评论 484 浏览 评分:9.9
简单易理解,利用循环解决此题 解题思路:注意事项:参考代码:a,b,c=map(int,input().split())d=0da=(1,3,5,7,8,10,12)xiao=(4,6,9,11)foriinrange(1,b):ifiinda:d+=31elifiinxiao:d+=30else:ifa%4==0or(a%4== 题解列表 2024年03月28日 1 点赞 0 评论 545 浏览 评分:9.9
1049: [编程入门]结构体之时间设计 ```pythonclassYear:def__init__(self):passdefput(self,year,mon,day):self.year=yearself.mon=monself.day=daydefcalculate(self):days=0foriinrange(1, 题解列表 2023年12月20日 1 点赞 0 评论 477 浏览 评分:0.0
结构体之时间设计 摘要:解题思路:注意事项:参考代码:def leap(year): if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0: …… 题解列表 2023年11月24日 1 点赞 0 评论 450 浏览 评分:10.0
[编程入门]结构体之时间设计-题解(Python代码) 解题思路:注意事项:参考代码:year,mouth,day=map(int,input().split())list1=[31,28,31,30,31,30,31,31,30,31,30,31]ifyear%400==0or(year%4==0andyear%100!=0):list1[1]=29pr 题解列表 2023年11月04日 1 点赞 0 评论 646 浏览 评分:9.9
python天数计算——挑战最简解 摘要:python就不讲什么结构体了,咱没有这玩意参考代码:year, month, day = map(int, input().split()) days1 = [31, 28, 31, 30, 31…… 题解列表 2023年08月19日 1 点赞 0 评论 585 浏览 评分:0.0
结构体之时间设计 解题思路:注意事项:参考代码:a,b,c=map(int,input().split())#输入list1=[31,29,31,30,31,30,31,31,30,31,30,31]#闰年每月日期list2=[31,28,31,30,31,30, 题解列表 2023年04月07日 0 点赞 0 评论 535 浏览 评分:9.9
结构体之时间设计——计算为一年的第几天 解题思路:将有31天和30天的月份分开来用列表存放,然后计算注意事项:闰年2月比平年多一天并不是为奇数的月份的天数就有31天参考代码:a,b,c=map(int,input().split())L1=[1,3,5,7,8,10,12]L2=[4, 题解列表 2023年03月14日 0 点赞 0 评论 458 浏览 评分:0.0