Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main ()
- {
- long long n,d=2,nreprim=1,i=2,j=2,eprim,poz=0,d2=2,pozepr=1;
- cin>>n;
- while (d<=n/2&&nreprim==1)
- {
- if (n%d==0)
- nreprim=0;
- d++;
- }
- while (i<=n)
- {
- eprim=1;
- while (j<=i/2&&eprim==1)
- { if (i%j==0)
- eprim=0;
- j++;
- }
- i++;
- if (eprim)
- poz++;
- }
- while (d2<=poz/2)
- {
- if (poz%d2==0)
- pozepr=0;
- d2++;
- }
- if (pozepr==1&&nreprim==1)
- cout<<"Da";
- else
- cout<<"Nu";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement