fork download
  1. s = input()
  2. p = False
  3.  
  4. if (s[2] != '-') or not((s[0]>='A')and(s[3]>='A')and(s[0]<='H')and(s[3]<='H')) or not((s[1]>='1')and(s[4]>='1')and(s[1]<='8')and(s[4]<='8')):
  5. print("ERROR")
  6. else:
  7. x1 = ord(s[0]-64)
  8. x2 = orc(s[3]-64)
  9. if (abs(x2-x1) == 2)and(abs(int(s[1])-int(s[4])) == 1):
  10. p = True
  11. if (abs(x2-x1) == 1)and(abs(int(s[1])-int(s[4])) == 2):
  12. p = True
  13. if p:
  14. print("YES")
  15. else:
  16. print("NO")
  17.  
  18.  
  19.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
C7-D5
compilation info
prog.pas:1: error: syntax error before `s'
stdout
Standard output is empty