fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;cin>>n;
  6. bool isp=true;
  7. if(n<=1) isp=false;
  8. for(int i=2;i<n;i++)
  9. {
  10. if(n%i==0)
  11. {
  12. isp=false;
  13. break;
  14. }
  15. }
  16. if(isp) cout<<"y";
  17. else cout<<"n";
  18. }
Success #stdin #stdout 0s 5316KB
stdin
5
stdout
y