Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool sito[10000];
- void ESito() {
- for(int i = 0; i < 10000; i++)
- sito[i] = true;
- for(int i = 2; i < 10000; i++) {
- for(int j = i * 2; j < 10000; j = j + i)
- sito[j] = false;
- }
- for(int i = int(char('A')); i <= int(char('Z')); i++)
- if(sito[i])
- cout << char(i) << " ";
- }
- int main() {
- ESito();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment