Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- bool prim(long long &a,long long &b){
- if(a<=1 || b<=1){
- return false;
- }
- if(a!=0){
- for(int i=2;i<a;i++){
- if(a%i==0){
- return false;
- }
- }}
- if(b!=2){
- for(int i=2;i<b;i++){
- if(b%i==0){
- return false;
- }
- }
- }
- return true;
- }
- int main()
- {
- long long n;
- cin>>n;
- for(long long i=1;i<n;i++){
- for(long long j=1;j<n;j++){
- if(prim(i,j) && i+j==n){
- cout<<i<<"+"<<j<<"="<<n<<endl;
- return 0;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment