ayusho
1
i checked every input. Its giving the right output but the judge says “wrong answer”. Whats wrong with it?
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
int power(int);
int main()
{ int t,n,q;
scanf("%d",&t);
while(t–)
{
scanf("%d",&n);
int powerv=power(n);
int powsum=0;
for(q=1;q<powerv;++q)
{
float f=n/pow(5,q);
powsum=powsum + floor(f);
}
printf("%d\n",powsum);
}
return 0;
}
int power(int n)
{
int i;
for(i=0;i<n;i++)
{
if(pow(5,i)>n)
break;
}
return i;
}
devil5
2
what problem you are facing?
devil5
3
what problem you are facing?
ayusho
4
i checked the output on codeblocks. Its working fine.
But here on codechef…its saying wrong answer!!
#include<stdio.h>
#include<conio.h>
void main()
{
int fact,f;
printf(“enter any no”);
scanf("%d",&f);
if(f==0||f==1)
{
printf(“fact=1”);
}
else
{
for(int i;i<=f;i++)
Blockquote
{
fact=f*fact;
}
printf(“fact=%d”,&fact);
}
getch();
}
This solution will not be accepted by CodeChef since <conio.h> is not a part of the C Standard Library.