TLE code:
#include<bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
if (n <= 1) {
return false;
}
for (int i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
int main()
{
cin.tie(0)->sync_with_stdio(false);
int s, e;
cin>>s>>e;
for(int i=s; i<=e; i++){
if (isPrime(i)){
cout<<i<<endl;
}
}
return 0;
}
help