asgarlikanan

https://www.e-olymp.com/az/problems/1616

Aug 6th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 0.34 KB | None | 0 0
  1. /*
  2.     Author: Kanan Asgarli
  3.     https://www.e-olymp.com/az/problems/1616
  4. */
  5. #include <iostream>
  6. #include <cmath>
  7. using namespace std;
  8. int n;
  9. string prime(){
  10.     for(int i = 2; i <= (int)sqrt(n); i++)
  11.         if(n % i == 0)
  12.             return "No";
  13.     return "Yes";
  14. }
  15. int main()
  16. {
  17.    cin>>n;
  18.    cout<<prime()<<endl;
  19.    return 0;
  20. }
Add Comment
Please, Sign In to add comment