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