题解 1049: [编程入门]结构体之时间设计

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

结构体之时间设计

摘要:解题思路:注意事项:参考代码:def leap(year):    if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:        ……

萌新也能轻松AC之结构体之时间设计

#MarkDown编辑器基本使用说明```pythonclassToday:创建年月日结构体def__init__(self,year,month,day):self.year=yearself.month=monthself.day=daydefdate_of_today(self):定义日期转换函

简单易懂,结构体之时间设计

摘要:解题思路:平年2月28天,闰年2月29天,平年闰年分开考虑注意事项: 无参考代码:y, m, d = map(int, input().split()) day_num = d year1 = [……

简单易理解,利用循环解决此题

解题思路:注意事项:参考代码: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==

结构体之时间设计

解题思路:注意事项:参考代码: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,

结构体之时间设计

解题思路:注意事项:参考代码:y,m,d=map(int,input().split())m1=[1,3,5,7,8,10,12]m2=[4,6,9,11]s=0foriinrange(1,m):ifiinm1:s+=31elifiinm2:s+=30else:s+=28s+=dify%4==0and