-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path46.cpp
More file actions
48 lines (39 loc) · 808 Bytes
/
Copy path46.cpp
File metadata and controls
48 lines (39 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include<iostream>
#include<cmath>
using namespace std;
int b[100001];
int j=3;
int max1=0;
int isprime(int x)
{
for(int i=0;i<j;i++)
if(b[i]==x)
return 1;
return 0;
}
int main()
{b[0]=2;b[1]=3;b[2]=5;
for( int k=7;k<10000;k+=2)
{int l=0;
for(int i=0;i<j;i++)
if(k%b[i]==0)
{l=1;break;}
if(!l)
{b[j]=k;
j++;}
else
{int u=0;
for(int i=0;i<j;i++)
{int c=k-b[i];
c/=2;
if((int)sqrt(c)==sqrt(c))
{u=1;break;}
}
if(u==0)
{ cout<<k<<endl;system("pause");return 0;}
// cout<<b[2]<<"\t"<<k<<endl;
}
}
system("pause");
return 0;
}