Page 1 of 1

10851 - 2D Hieroglyphs decoder

Posted: Thu May 26, 2005 11:57 am
by vivander
I have WA in this problem. Can anyone tel me some critical input cases?

AC

Posted: Thu May 26, 2005 12:23 pm
by vivander
I just have AC.

10851 ! Strange Problem....helppppp

Posted: Thu May 26, 2005 4:12 pm
by Niaz
Strange Problem!
When I take the input, my compiler take

Posted: Thu May 26, 2005 5:03 pm
by Krzysztof Duleba
'\\' is a single charater, just like '\n'. And guess what? (int)('\\') = 92. You do read it properly. However, you print it in a wrong way - try casting to char first.

Posted: Fri May 27, 2005 6:00 pm
by Niaz
Thanks for ur replay.
I know that '\\' this is a single character. But what will be the method to
take the input ?
Now, I am just taking the inputs using gets() and then whenever I get
'\\', I just make it '\' and insert a '\' next to it.

Posted: Fri May 27, 2005 7:00 pm
by Cho
You can use scanf:

Code: Select all

char s[128];
scanf("%s", s);
Then either s=='/' or s=='\\' will be true.