Ejemplo n.º 1
0
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')
Ejemplo n.º 2
0
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')
Ejemplo n.º 3
0
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')
Ejemplo n.º 4
0
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')
Ejemplo n.º 5
0
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')