paycheck to paycheck:谁把这个代码翻译一下

来源:百度文库 编辑:杭州交通信息网 时间:2024/06/03 07:00:45
print amPmTime$(time$())

function amPmTime$(time$)

colonIndex = instr(time$, ":")
hours = val(left$(time$, colonIndex - 1))
amOrPm$ = " AM"
if hours > 12 then
hours = hours - 12
amOrPm$ = " PM"
else
if hours = 0 then hours = 12
end if
amPmTime$ = str$(hours) + mid$(time$, colonIndex) + amOrPm$

end function
PRINT "HH HH BBBBBB YY YY LL"
PRINT "HH HH BB BB YY YY LL"
PRINT "HH HH BB BB YY YY LL"
PRINT "HHHHHHH BBBBBBB YYY LL"
PRINT "HH HH BB BB YYY LL"
PRINT "HH HH BB BB YYY LL"
PRINT "HH HH BBBBBB YYY LLLLLLLLL"
print amPmTime$(time$())
function amPmTime$(time$)
colonIndex = instr(time$, ":")
hours = val(left$(time$, colonIndex - 1))
amOrPm$ = " AM"
if hours > 12 then
hours = hours - 12
amOrPm$ = " PM"
else
if hours = 0 then hours = 12
end if
amPmTime$ = str$(hours) + mid$(time$, colonIndex) + amOrPm$
end function