the problem will be counted as solved only
yet,
the problem with ur progrm is that it outputs an extra space
when u print the last number u put an extra spaceif(a>1){printf("x ");}
and thats all the mistake that u have done and nothing more
Moderator: Board moderators
Code: Select all
49
64
Code: Select all
77
88
Code: Select all
else
{
for(i=0;p%prima[i]!=0&&(double)prima[i]<=sqrt((double)p);i++);
if(p%prima[i]==0)
{ printf("%ld",prima[i]);
p/=prima[i];
}
if((double)prima[i]>sqrt((double)p))
{
printf("%ld\n",p);
continue;
}
}
Code: Select all
for(i=0;p%prima[i]!=0&&(double)prima[i]<=sqrt((double)p);i++);