def main(): ch = Checker() while True: l = ch.readInt() if l == 0: break ch.checkRange(l, L_MIN, L_MAX, 'L') s = ch.readString() ch.checkValidCharacter(s, '+-.') ch.checkRange(len(s), l, l, 'length of S')
def main(): ch = Checker() while True: n = ch.readInt() if n == 0: break ch.checkRange(n, MIN, N_MAX, 'N') for _ in xrange(n): s = ch.readString() ch.checkValidCharacter(s, string.ascii_uppercase) ch.checkLength(s, n, 'S', 'N')
def main(): ch = Checker() while True: n = ch.readInt() if n == 0: break ch.checkRange(n, MIN, N_MAX, 'N') for _ in xrange(n): d, l = ch.matchRegex(r'(\w) (\d)') l = int(l) ch.checkValidCharacter(d, 'LR') ch.checkRange(l, MIN, L_MAX, 'L')