eolymp
bolt
Try our new interface for solving problems
Problems

Prime numbers

published at 11/14/21, 5:16:48 pm

lol

published at 1/26/24, 5:29:32 pm

include <bits/stdc++.h>

using namespace std; bool sade(long long n){

if(n<2){
    return false;
}

for(int i=2; i*i<=n;i++){

if(n%i==0){
        return false;
    }

} return true ;

}

int main() { long long n,m; int say=0; cin>>n>>m; for(int i=n; i<=m;i++){ if(sade(i)){ cout<<i<<endl; say++; }

} if(say==0){ cout<<"Absent"; } }