Initial commit

This commit is contained in:
oleg20111511
2022-06-01 20:14:50 +03:00
commit ea38bff9db
1095 changed files with 68907 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#include <iostream>
#include <list>
#include <cmath>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int start, end;
cin >> start >> end;
int notPrimes[end + 5] = {0};
bool foundPrime = false;
for (int i = 2; i <= end; i++) {
if (notPrimes[i] != 0) {
continue;
}
if (start <= i && i <= end) {
cout << i << " ";
foundPrime = true;
}
for (int j = i; j <= end; j += i) {
notPrimes[j] = i;
}
}
if (!foundPrime) {
cout << "Absent" << endl;
}
return 0;
}