Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "ru");
- for (int i = 2; i <= 1000; i++) {
- int j = 2;
- for (; j < i; j++) {
- if (i % j == 0) {
- break;
- }
- }
- if (j == i) {
- cout << i << " ";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment