6.13的练习

Posted yuanke98

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了6.13的练习相关的知识,希望对你有一定的参考价值。

#!Usr/bin/env python
# -*- coding:utf-8 -*-
# Author:Alex  Li
‘‘‘一个整数,它加上100后是一个完全平方数,再加上268又是一个完全平方数,请问该数是多少?‘‘‘
for i in range(1,1000):
    for j in range(1,1000):
        if i+100==j**2 :
            for l in range(1,1000):
                if i+268==l**2:
                    print(i)


‘‘‘
输入某年某月某日,判断这一天是这一年的第几天?
‘‘‘
‘‘‘
year_=input(33[41;1m year:33[0m)
month_=input(33[41;1m month:33[0m)
day_=input(33[41;1m day::33[0m)
year_=int(year_)
month_=int(month_)
day_=int(day_)
if month_==1:
        a=day_
elif 1<month_<=2:
        a=31+day_
elif 2<month_<=3:
        a=31+28+day_
elif 3<month_<=4:
        a=31+28+31+day_
elif 4 < month_ <= 5:
        a = 31 + 28 + 31 + day_+30
elif 5< month_ <= 6:
        a= 31 + 28 + 31 + day_ + 30+31
elif 6< month_ <= 7:
        a= 31 + 28 + 31 + day_ + 30 + 31+30
elif 7< month_ <= 8:
        a= 31 + 28 + 31 + day_ + 30 + 31 + 30+31
elif 8 < month_ <= 9:
        a= 31 + 28 + 31 + day_ + 30 + 31 + 30 + 31+31
elif 9 < month_ <= 10:
        a= 31 + 28 + 31 + day_ + 30 + 31 + 30 + 31 + 31+30
elif 10< month_ <= 11:
        a= 31 + 28 + 31 + day_ + 30 + 31 + 30 + 31 + 31 + 30+31
elif 11 < month_ <= 12:
        a= 31 + 28 + 31 + day_ + 30 + 31 + 30 + 31 + 31 + 30 + 31+30
if (year_%4==0 and year_%100!=0) or year_%400==0:
    a-=1
    print(a)
else:
    print(a)
‘‘‘
#MD上面是我写的傻逼代码



year=int(input(year:
))
month=int(input(month:
))
day=int(input(day:
))
months=(0,31,59,90,120,151,181,212,243,273,304,334)
if 0<=month<=12:
    sum=months[month-1]
else:
    print(data error)
sum+=day
leap=0
if(year%4==0 and  year%100!=0)or year%400==0:
    leap=1
if(leap==1)and (month>2):
    sum+=1
print(33[41;1m it is the %dth day33[0m%sum)#033[41;1m day::033[0m

 

以上是关于6.13的练习的主要内容,如果未能解决你的问题,请参考以下文章

Python练习册 第 0013 题: 用 Python 写一个爬图片的程序,爬 这个链接里的日本妹子图片 :-),(http://tieba.baidu.com/p/2166231880)(代码片段

开发实践教程1:试卷生成系统6.13 试卷搜索(FormPaperManagerQuery)

csharp Epicor标准练习片段

golang 去练习片段

6.13—042—周四

6.13日记