本文整理匯總了Python中checker.Checker.readLine方法的典型用法代碼示例。如果您正苦於以下問題:Python Checker.readLine方法的具體用法?Python Checker.readLine怎麽用?Python Checker.readLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類checker.Checker
的用法示例。
在下文中一共展示了Checker.readLine方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readLine [as 別名]
def main():
ch = Checker()
while True:
n = int(ch.readLine())
if n == 0:
break
ch.checkRange(n, 3, 50, 'n')
ps = []
for _ in range(n):
x, y = [int(w) for w in ch.readLine().strip().split()]
ch.check((x, y) not in ps, "no dup points: (%d, %d)" % (x, y))
ch.checkRange(x, -500, 500, 'x')
ch.checkRange(y, -500, 500, 'y')
ps.append((x, y))
示例2: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readLine [as 別名]
def main():
ch = Checker()
while True:
n = int(ch.readLine())
if n == 0:
break
ch.checkRange(n, 1, 5, 'n')
ps = set()
ps.add((0, 0))
for _ in range(n):
x, y = [int(w) for w in ch.readLine().strip().split()]
ch.check((x, y) not in ps, "no dup points")
ch.checkRange(x, -50, 50, 'x')
ch.checkRange(y, -50, 50, 'y')
ps.add((x, y))
示例3: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readLine [as 別名]
def main():
ch = Checker()
while True:
n = int(ch.readLine())
if n == -1:
break
ch.checkRange(n, 0, 23, 'n')
ps = set()
ps.add((1, 1))
ps.add((5, 5))
for _ in range(n):
x, y = [int(w) for w in ch.readLine().strip().split()]
ch.check((x, y) not in ps, 'no dup points')
ch.checkRange(x, 1, 5, 'x')
ch.checkRange(y, 1, 5, 'y')
ps.add((x, y))
示例4: main
# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readLine [as 別名]
def main():
ch = Checker()
while True:
a = int(ch.readLine())
if a == -1:
break
ch.checkRange(a, 0, 315, 'd')
ch.check(a % 45 == 0, 'd is a multiple of 45')