Submission #2823504


Source Code Expand

const
  n3 = "not not not"
  n3s = "not not not "
  n2s = "not not "
  n1s = "not "

var
  S = readLine stdin
  T =  ""

proc judge(S, s: string): bool =
  if S.len >= s.len and S[0 .. s.high] == s:
    return true

while S.len != 0 and S != n3:
  if judge(S, n3s):
    add T, n1s
    S = S[n1s.len .. ^1]
  elif S.len > n2s and S[0 .. n2s.high] == n2s:
    S = S[n2s.len .. ^1]
  else:
    add T, S[0]
    S = S[1 .. ^1]

echo T & S

Submission Info

Submission Time
Task A - 二重否定除去法則
User ToshiroYanagi
Language Nim (0.13.0)
Score 0
Code Size 459 Byte
Status CE

Compile Error

Hint: system [Processing]
Hint: Main [Processing]
Main.nim(19, 14) template/generic instantiation from here
lib/system.nim(357, 5) Error: type mismatch: got (string, int)
but expected one of: 
system.<(x: Enum, y: Enum)
system.<(x: string, y: string)
system.<(x: char, y: char)
system.<(x: set[T], y: set[T])
system.<(x: bool, y: bool)
system.<(x: ref T, y: ref T)
system.<(x: ptr T, y: ptr T)
system.<(x: pointer, y: pointer)
system.<(x: int64, y: int64)
system.<(x: T, y: T)
system.<(x: float32, y: float32)
system.<(x: T, y: T)
system.<(x: int, y: int)
system.<(x: int8, y: int8)
system.<(x: int16, y: int16)
system.<(x: float, y: float)
system.<(x: ordinal[T])
system.<(x: int32, y: int32)