本文整理汇总了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')