anders@anders-Satellite-U400:~/puzzle$ cat novel_she_calf.c
#include stdio.h
/*
iIf a cow produces its first she-calf at age two years and after that
produces another single she-calf every year, how many she-calves are
there after 12 years? assuming none die.
*/
unsigned int she_calves(unsigned
On Tue, Jun 28, 2011 at 3:04 PM, sagar pareek sagarpar...@gmail.com wrote:
I have 1 more solution :-
#includestdio.h
#includestring.h
main()
{
int i,j,l;
char arr[100];
printf(Enter the string\n);
fgets(arr,100,stdin);
for(i=0,l=strlen(arr),j=l;i=l/2;i++)
{
arr[j--]=arr[i];
I think the answer is 5.
To know which one is poisonous, you have to use one mouse.
How to use 3 mice achieve this goal?
If all the 3 mice drink the poisonous beer, they will die first, how
does the test go on?
although you can let one mouse drink several beer in different time
table, but if the
1) go to 1000/3 with 1000 babanas, reserves 1000/3 at 1000/3 position
2) same as 1)
now there are 2000/3 bananas at 1000/3 position.
3) go to 1000/3 position with 1000 babanas, then there are (2000/3 +
1000 - 1000/3) = 4000/3 babanas
4) go to (1000/3 + (4000/3 -1000)/3) = 4000/9 position with
I‘v no idea, please give detail analysis, thanks!
On Mon, May 16, 2011 at 5:26 PM, Piyush Sinha ecstasy.piy...@gmail.com wrote:
@vivek...how come only one?? I think its 8...
On Mon, May 16, 2011 at 1:03 PM, Lavesh Rawat lavesh.ra...@gmail.com
wrote:
W Riddle
George Washington's wife was
take “aabab” for example, the result is aba, b,a; however, the
right result is aa,bab
On Wed, May 11, 2011 at 10:57 AM, shubham shubh2...@gmail.com wrote:
check this one out:
#includeiostream
#includecstdio
#includevector
#includecstring
using namespace std;
int check_palin(string
sometimes we need goto, goto is not so evil.
On Tue, May 10, 2011 at 2:49 AM, Manjeet Chayel
chayel.manj...@gmail.com wrote:
Dont use goto... its not good to have it.
On Mon, May 9, 2011 at 2:44 PM, Anders Ma xuejiao...@gmail.com wrote:
#include stdio.h
#include string.h
int
, 2011 at 10:11 AM, oldman fenghaungyuyi...@gmail.com wrote:
I agree with Anders Ma's point,but in my opinion, using goto is risky in a
import interview
On Tue, May 10, 2011 at 9:52 AM, Anders Ma xuejiao...@gmail.com wrote:
sometimes we need goto, goto is not so evil.
On Tue, May 10, 2011 at 2
when they are getting only one coins
each?
On Thu, Apr 21, 2011 at 3:05 PM, harshit agrawal
hagrawal.250...@gmail.com wrote:
thwy will be shared according to
senior most pirate(5th)=98
4th =0
3rd =1
2nd=0
1st =1
On Thu, Apr 21, 2011 at 2:54 PM, Anders Ma xuejiao...@gmail.com wrote
I googled and got the answer, if not, I can not find out even 1000 years.
On Fri, Apr 22, 2011 at 3:58 PM, Anurag atri anu.anurag@gmail.com wrote:
hehe :)
here is a hint : dots and dashes :)
On Fri, Apr 22, 2011 at 12:53 PM, Shuaib aries.shu...@gmail.com wrote:
Well, I know the answer,
the coins will be shared the way the oldest pirate proposes.
On Thu, Apr 21, 2011 at 3:51 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote:
Pirate Puzzle
5 pirates of different ages have a treasure of 100 gold coins.
On their ship, they decide to split the coins using this scheme:
The oldest
the segment which stores hello may be read only, so writing to it
may cause unexpected result.
On Thu, Apr 21, 2011 at 6:45 PM, rahul rahulr...@gmail.com wrote:
will crash... :)
On Thu, Apr 21, 2011 at 4:14 PM, riti gupta ritigupt...@gmail.com wrote:
is there any error in following code?
they are getting only one coins
each?
On Thu, Apr 21, 2011 at 3:05 PM, harshit agrawal
hagrawal.250...@gmail.com wrote:
thwy will be shared according to
senior most pirate(5th)=98
4th =0
3rd =1
2nd=0
1st =1
On Thu, Apr 21, 2011 at 2:54 PM, Anders Ma xuejiao...@gmail.com wrote:
the coins
Introduction to algorithms
http://www.amazon.com/Introduction-Algorithms-Third-Thomas-Cormen/dp/0262033844
On Tue, Apr 19, 2011 at 5:06 PM, Vishnutej
mylavarapu.vishnu...@gmail.com wrote:
Hello everyone,
Wat according to u are the basic algorithms that a programmer should
know for sure?
If
14 matches
Mail list logo