Habsburg

1.

May 25th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. bool sito[10000];
  4.  
  5. void ESito() {
  6.     for(int i = 0; i < 10000; i++)
  7.         sito[i] = true;
  8.    
  9.     for(int i = 2; i < 10000; i++) {
  10.         for(int j = i * 2; j < 10000; j = j + i)
  11.             sito[j] = false;
  12.     }
  13.    
  14.     for(int i = int(char('A')); i <= int(char('Z')); i++)
  15.         if(sito[i])
  16.             cout << char(i) << " ";
  17. }
  18.  
  19. int main() {
  20.     ESito();
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment