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