本文整理匯總了Python中checker.Checker.readInts方法的典型用法代碼示例。如果您正苦於以下問題:Python Checker.readInts方法的具體用法?Python Checker.readInts怎麽用?Python Checker.readInts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類checker.Checker
的用法示例。
在下文中一共展示了Checker.readInts方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInts [as 別名]
def main():
ch = Checker()
while True:
n, p = ch.readInts(2)
if n == 0 and p == 0:
break
ch.checkRange(n, MIN, N_MAX, 'N')
ch.checkRange(p, MIN, P_MAX, 'P')
ts = ch.readInts(n)
for t in ts:
ch.checkRange(t, MIN, T_MAX, 'T')
示例2: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInts [as 別名]
def main():
ch = Checker()
while True:
r, n = ch.readInts(2)
if r == 0 and n == 0:
break
ch.checkRange(r, R_MIN, R_MAX, 'R')
ch.checkRange(n, N_MIN, N_MAX, 'N')
xs = ch.readInts(n)
ch.checkSorted(xs, 'Xs')
ch.checkUnique(xs, 'Xs')
for x in xs:
ch.checkRange(x, X_MIN, X_MAX, 'X')
示例3: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInts [as 別名]
def main():
ch = Checker()
while True:
coefficients = ch.readInts(4)
if coefficients == [0, 0, 0, 0]:
break
for i in xrange(len(coefficients)):
ch.checkRange(coefficients[i], MIN, MAX, chr(ord('A') + i))
示例4: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInts [as 別名]
def main():
ch = Checker()
while True:
a, b = ch.readInts(2)
if a == 0 and b == 0:
break
ch.checkRange(a, MIN, MAX, 'A')
ch.checkRange(b, MIN, MAX, 'B')
示例5: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInts [as 別名]
def main():
ch = Checker()
while True:
n = ch.readInt()
if n == 0:
break
ch.checkRange(n, MIN, N_MAX, 'N')
as_ = ch.readInts(n)
for a in as_:
ch.checkRange(a, MIN, A_MAX, 'A')
示例6: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readInts [as 別名]
def main():
ch = Checker()
while True:
n = ch.readInt()
if n == 0:
break
ch.checkRange(n, N_MIN, N_MAX, 'N')
ts_ = ch.readInts(n)
for t in ts_:
ch.checkRange(t, T_MIN, T_MAX, 'T')