水柔姐姐种子:谁把这个代码翻译一下

来源:百度文库 编辑:中科新闻网 时间:2024/04/28 23:49:32
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