U E D R , A S I H C RSS

코드레이스/2007.03.24상협지훈

코드1

def check(num):
    rest = num%150
    if rest < 120:
        print "red"
    else:
        print "green"
        
num = input(">>")
check(num)

코드2



def check(num):
    rest = num%150
    if rest < 120:
        print "red"
    else:
        print "green"
        
numList = raw_input(">>")
year, month, day, time, minute, sec = map(int,numList.split(" "))
sec = ((((((year-2000)*12 + month)*30 + day)*24 + time)*60 + minute)*60 + sec )
check(sec)

코드3

def check(num):
    rest = num%150
    if rest < 120:
        return "red"
    else:
        return "green"
manNum = input()
breakCt = 0
for i in range(0,manNum):
    numList = raw_input(">>")
    year, month, day, time, minute, sec = map(int,numList.split(" "))
    sec = ((((((year-2000)*12 + month)*30 + day)*24 + time)*60 + minute)*60 + sec )
    
    if check(sec) == "red":
        breakCt += 1
print breakCt

코드4

def check(num):
    rest = num%155
    if rest < 120:
        return "red"
    else:
        return "green"
manNum = input()
breakCt = 0
for i in range(0,manNum):
    numList = raw_input(">>")
    year, month, day, time, minute, sec = map(int,numList.split(" "))
    sec = ((((((year-2000)*12 + month)*30 + day)*24 + time)*60 + minute)*60 + sec )
    
    if check(sec) == "red":
        breakCt += 1
print breakCt
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:31:19
Processing time 0.0146 sec