10851 - 2D Hieroglyphs decoder

All about problems in Volume 108. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
vivander
New poster
Posts: 8
Joined: Sat May 21, 2005 2:13 am

10851 - 2D Hieroglyphs decoder

Post by vivander » Thu May 26, 2005 11:57 am

I have WA in this problem. Can anyone tel me some critical input cases?

vivander
New poster
Posts: 8
Joined: Sat May 21, 2005 2:13 am

AC

Post by vivander » Thu May 26, 2005 12:23 pm

I just have AC.

Niaz
Learning poster
Posts: 77
Joined: Fri Dec 17, 2004 11:06 am
Location: East West University, Dhaka, Bangladesh
Contact:

10851 ! Strange Problem....helppppp

Post by Niaz » Thu May 26, 2005 4:12 pm

Strange Problem!
When I take the input, my compiler take
Please join The ACM Solver Group at Yahoo
http://groups.yahoo.com/group/acm_solver/

User avatar
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba » Thu May 26, 2005 5:03 pm

'\\' 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.

Niaz
Learning poster
Posts: 77
Joined: Fri Dec 17, 2004 11:06 am
Location: East West University, Dhaka, Bangladesh
Contact:

Post by Niaz » Fri May 27, 2005 6:00 pm

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.
Please join The ACM Solver Group at Yahoo
http://groups.yahoo.com/group/acm_solver/

User avatar
Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong

Post by Cho » Fri May 27, 2005 7:00 pm

You can use scanf:

Code: Select all

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

Post Reply

Return to “Volume 108 (10800-10899)”