Untitled
unknown
plain_text
2 years ago
507 B
1
Indexable
Never
#include <iostream> #include <cmath> using namespace std; int main() { int a, b, flag; flag = 0; cin >> a >> b; for (int i = a; i < b + 1; i++){ if (i == 2 || i == 3) cout << i << endl; else if (i != 1) { for (int j = 2; j < i; j++) { if (i % j == 0) { flag = 1; break; } } if (flag != 1) cout << i << endl; flag = 0; } } }