Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- void numar(int x, int &nrp)
- {
- nrp=0;
- for(int i=2; i<=x; i++)
- {
- int d=0;
- for(int j=2; j<i/2; j++)
- if(i%j==0)
- d++;
- if(d==0)
- nrp++;
- }
- }
- int main()
- {
- int a,b,p1,p2;
- cin>>a;
- cin>>b;
- if(a>b)
- {
- int aux=a;
- a=b;
- b=a;
- }
- numar(a, p1);
- numar(b, p2);
- if(p2-p1)
- cout<<"DA";
- else
- cout<<"NU";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement