Habsburg

3.

May 25th, 2015
313
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.  
  4. bool sito[10000];
  5.  
  6. void ESito() {
  7.     for(int i = 0; i < 10000; i++)
  8.         sito[i] = true;
  9.    
  10.     for(int i = 2; i < 10000; i++) {
  11.         for(int j = i * 2; j < 10000; j = j + i)
  12.             sito[j] = false;
  13.     }
  14.    
  15.     for(int i = int(char('a')); i <= int(char('z')); i++)
  16.         if(!sito[i])
  17.             cout << char(i) << " ";
  18. }
  19.  
  20. int main() {
  21.     ESito();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment