코드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