|
|
back to boardIO tips and other First of all make sure that you are not reading newlines and carriage return symbols. Input can be read like: char c; int scanfRez; do { scanfRez = scanf("%c", &c); if (scanfRez != EOF && c != '\n' && c != '\r') { chs[chCount++] = c; } }while(scanfRez != EOF); I was getting WA7 with this input reading: char c; int scanfRez; do { scanfRez = scanf("%c", &c); if (c != '\n' && c != '\r') { chs[chCount++] = c; } }while(scanfRez != EOF); If you get WA3 make sure that you are processing sequence correctly with given sequence length > N. For example: let N = 11, input sequence = "abcdefghijkl" (without quotes) then letters should be removed in this order: k 1 j 2 l 3 b 4 e 5 i 6 g 7 h 8 d 9 a 10 c 11 f 12 It does not matter if you put newline at the end of output. |
|
|