Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<iomanip>
- #include<cmath>
- using namespace std;
- bool prostBroj (int a)
- {
- bool u = true;
- for (int i = 2; i<=int(sqrt(a)); i++)
- if (a % i == 0)
- u = false;
- return u;
- }
- int main()
- {
- int n;
- cin>>n;
- for (int p=8;p<n;p++)
- {
- if (prostBroj(p)==true)
- if (prostBroj(n-p)==true)
- cout<<n-p<<endl;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement