ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1354. Palindrome. Again Palindrome

For Haskell programmers: '\r' character in input
Posted by b108 8 Jan 2014 21:53
I have WA#1 but algo was right.
I use this construction:

import qualified Data.ByteString.Char8 as C8

...

input <- C8.getLine

C8.putStr $ result input


----------

But I have always WA#1. At my PC (Linux) I have right answers.

then i tried:


input' <- C8.getLine

let
      input = if (C8.index input' (-1 + C8.length input')) == '\r' then C8.init input' else input'

--------

So, i removed last character '\r' from line if it exists. And after this my code was accepted!