字符
1、字符转换
1 def check(s): 2 if len(s) <= 8: 3 return 0 4 a, b, c, d = 0, 0, 0, 0 5 for item in s: 6 if ord('a') <= ord(item) <= ord('z'): 7 a = 1 8 elif ord('A') <= ord(item) <= ord('Z'): 9 b = 1 10 elif ord('0') <= ord(item) <= ord('9'): 11 c = 1 12 else: 13 d = 1 14 if a + b + c + d < 3: 15 return 0 16 for i in range(len(s)-3): 17 if len(s.split(s[i:i+3])) >= 3: 18 return 0 19 return 1 20 21 while 1: 22 try: 23 print('OK' if check(input()) else 'NG') 24 except: 25 break