change :
Code: Select all
if(k>15) printf("\n ");
Code: Select all
if(k>15) printf("\n ");
change:
Code: Select all
for(i=0;a[i]<=n;i++)
Code: Select all
for(i=0;a[i]<=n&&i<25;i++)

Moderator: Board moderators
Code: Select all
if(k>15) printf("\n ");
Code: Select all
if(k>15) printf("\n ");
Code: Select all
for(i=0;a[i]<=n;i++)
Code: Select all
for(i=0;a[i]<=n&&i<25;i++)
Your ouput is wrong..CrazyTerabyte wrote:Instead of starting a new thread, I will post in this one.
Here is my code:
I've tested it for all numbers from 2 to 100. The output looks correct to me. But I still get wrong answer. Can someone help me?
Code: Select all
1
2
3
4
5
100
0
Code: Select all
1! = 0
2! = 1
3! = 1 1
4! = 3 1
5! = 3 1 1
100! = 97 48 24 16 9 7 5 5 4 3 3 2 2 2 2
1 1 1 1 1 1 1 1 1 1
Code: Select all
1! = 0
2! = 0
3! = 1
4! = 1
5! = 1 1
100! = 48 24 16 9 7 5 5 4 3 3 2 2 2 2 1
1 1 1 1 1 1 1 1 1
I got exactly the same output as yours.helloneo wrote:Your ouput is wrong..
Try this input
Code: Select all
63
Code: Select all
63! = 57 30 14 10 5 4 3 3 2 2 2 1 1 1 1
1 1 1
Code: Select all
63! = 57 30 14 10 5 4 3 3 2 2 2 1 1 1 1
1 1 1
Code: Select all
deleted after Ac.. at last, i know my mistake.. hikx
Code: Select all
if(hasil[i])
{
else printf("%3lld", hasil[i]);
counter++;
}