Page 5 of 5

Re: 10929 - You can say 11

Posted: Tue Apr 01, 2014 12:18 am
by brianfry713
That is AC code

Re: 10929 - You can say 11

Posted: Tue Apr 01, 2014 9:14 am
by uDebug
jddantes wrote:Why is mine not accepted?
Did you mean for this line

Code: Select all

for(i=0; number[i];i++)
to be

Code: Select all

for(i=0;i<number[i];i++)
?

Re: 10929 - You can say 11

Posted: Tue Apr 01, 2014 9:12 pm
by brianfry713
v1n1t, no he didn't.

The code jddantes posted is AC.

Re: 10929 - You can say 11

Posted: Wed Apr 02, 2014 8:13 am
by uDebug
brianfry713 wrote:v1n1t, no he didn't.
Gotcha. Thanks for the clarification.

10929 - You can say 11

Posted: Sun Aug 17, 2014 8:48 pm
by ehsanulbigboss
:D

Re: 10929 - You can say 11

Posted: Mon Aug 18, 2014 2:11 am
by lighted

Code: Select all

Use code tags. Like this
My advice to you -> always copy/paste output format from sample or problem description. :)

Your output

Code: Select all

5038297 is multiple of 11.
112234 is not multiple of 11.
Sample output

Code: Select all

5038297 is a multiple of 11.
112234 is not a multiple of 11.

Re: 10929 - You can say 11

Posted: Fri Dec 05, 2014 3:59 pm
by Helaluddin_brur
removed after accepted
lighted wrote:
Your function call_div is not correct. Since it is a function it should return a value. There is no return command.
Thank's a lot guru

Re: 10929 - You can say 11

Posted: Fri Dec 05, 2014 5:30 pm
by lighted
Your code fails last case (112234). Also change line to

Code: Select all

printf("%d", fir[i]-'0');

Re: 10929 - You can say 11

Posted: Fri Dec 05, 2014 10:08 pm
by Helaluddin_brur
lighted wrote:
Your code fails last case (112234)
after changing printf("%lld", fir-'0'); to printf("%d", fir-'0');
for input

Code: Select all

112234

my output is

Code: Select all

112234 is not a multiple of 11.
but what is wrong here?

Re: 10929 - You can say 11

Posted: Sat Dec 06, 2014 3:43 pm
by lighted
Your code always prints that number is a multiple. http://ideone.com/oX6urL

Your function call_div is not correct. Since it is a function it should return a value. There is no return command. Or you should make it void function and pass parameter res by reference.

Code: Select all

void call_div(char *number, long long int div, long long int &res)