run time error anybody give me a solution
include<stdio.h>
#include<math.h>
#define max 2147483647
unsigned long int prime[max];
void sieve()
{
prime[1]=0;
unsigned long int n,s;
for(n=2;n<=max;n++)
prime[n]=1;
for(n=2;n<=sqrt(max);n++)
if(prime[n])
for(s=2;s<=max/n;s++)
prime[s*n]=0;
}
int main ...
Search found 3 matches
- Fri Aug 26, 2011 12:26 am
- Forum: Volume 101 (10100-10199)
- Topic: 10140 - Prime Distance
- Replies: 17
- Views: 9480
- Fri Aug 26, 2011 12:16 am
- Forum: Volume 101 (10100-10199)
- Topic: 10140 - Prime Distance
- Replies: 17
- Views: 9480
Re: 10140 - Prime Distance
run time error if anybody give me solution it would be better for me
plz help me to solve the problem...................
here is my code..................
plz help me to solve the problem...................
here is my code..................
- Thu Aug 25, 2011 5:34 pm
- Forum: Bugs and suggestions
- Topic: 11428 Cubes
- Replies: 1
- Views: 2351
Re: 11428 Cubes
wrong answer.......................plz give me a solution
#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c,i,j;
while(scanf("%d",&a)==1 && a!=0)
{
c=0;
b=sqrt(a);
for(i=b;i>=0;i--){
for(j=0;j<b;j++)
if((pow(i,3)-pow(j,3)==a)){
c++;
break;
}
if(c>0)
break;
}
if(c>0)
printf("%d %d\n",i,j ...
#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c,i,j;
while(scanf("%d",&a)==1 && a!=0)
{
c=0;
b=sqrt(a);
for(i=b;i>=0;i--){
for(j=0;j<b;j++)
if((pow(i,3)-pow(j,3)==a)){
c++;
break;
}
if(c>0)
break;
}
if(c>0)
printf("%d %d\n",i,j ...