Advertisement
lopezz

Bool prost

May 25th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. bool prost(int n)
  5. {
  6.         for (int j = 2; j <= n / 2; j++)
  7.                 if (!(n % j)) return false;
  8.         return true;
  9. }
  10.  
  11. int main()
  12. {
  13.     for (int i = 65; i < 90; i++)
  14.         if (prost(i)) cout << (char)i << endl;
  15.  
  16.  
  17.     system("pause");
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement