Page 3 of 4

Posted: Thu May 04, 2006 8:41 pm
by emotional blind
Ok I have edited my post
Thanks for helping me by showing my bad habit.

Posted: Thu May 04, 2006 9:44 pm
by serur
Hi fellows!

This toipic was very helpful to me, thanks!
But how to imitate end of line/newline/line break in the input?

Posted: Thu May 04, 2006 9:54 pm
by Darko
Usually it is ctrl+D, but it doesn't have to work. So you keep typing happily, newlines and all and end it with ctrl+D.

What OP is probably asking is "How do I do this standard I/O thingy?"

Redirection - make an input file (call it , for example, "in"). If your program is "app", then you just do:

Code: Select all

app < in
Or if you want to print output to a file (call it "out"):

Code: Select all

app < in > out
That way you can compare results directly (and if you have diff installed, it is much easier then going through the outputs line-by-line and it catches whitespace difference, too)

I hope that is what he wanted to know :)

Posted: Thu May 04, 2006 11:06 pm
by serur
Thank you, Darko!

One more question, please.
"Funny Encryption method"- please, explain, how they got hexadecimal representation of 265, and it's binary ?
I think 265==16*16+9, which is A09 in hexadecimal, then we substitute: A=1010, 9=1001, how we got 5 ?

Thank you.

Posted: Fri May 05, 2006 11:26 am
by emotional blind
Funny Encryption method
Problem Number?

Posted: Fri May 05, 2006 12:54 pm
by serur
Hi emotional blind!

10019 I believe

Posted: Sat May 06, 2006 6:55 pm
by emotional blind
In second case you have to consider 265 as hexadecimal number,
as the problem description says (so dont convert dec to hex)

now 2=0010, 6=0110,5=0101
b2=5, OK?

Why did you not post it here,
http://online-judge.uva.es/board/viewforum.php?f=9

Posted: Sun May 07, 2006 9:07 am
by serur
Thank you man!

10019sumbuddy help me!!!

Posted: Tue Jun 20, 2006 8:45 pm
by kolpobilashi
perhaps i am thinking in a wrong way...for the 2nd part of this problem i am doing it by, converting each digit to the corresponding binary no. and count the no. of 1s, as per as i know this is also another way to convert a decimal no to hex and then binary ( :roll: )
i got WA for the code below.... :(

Posted: Tue Jun 20, 2006 11:17 pm
by emotional blind
size of rem[10] is too small increase it to 14
the binary of 9999 need greater than 10 digit.

Posted: Wed Jun 21, 2006 4:52 am
by kolpobilashi
thanx a lotttt again Arif bhai..... :D
but when i will be able to fix such silly problems myself!! :(

Posted: Wed Jun 21, 2006 4:09 pm
by emotional blind
practice makes a man perfect, you know!

10019--- compile error

Posted: Sun Oct 08, 2006 11:21 am
by chetan
hello people. here is my code for the problem funny encryption.
i get CE . can anybody help me out.

i just count the number of 1 in the binary representation directly..........

here's my code.....

Code: Select all


CODE DELETED AFTER AC :-) 

10019 Why Compile Error

Posted: Fri Mar 30, 2007 1:32 am
by ranacse05
My code is here :
*************code removed***************

Posted: Fri Mar 30, 2007 2:04 pm
by nymo
conio.h is a non standard header. NEVER include this header in files to be submitted in UVa.
If you are uncertain about other functions or headers, try checking their portability first.

NEVER open a new thread when there are already many...