ALGORITMI ZADATAK 1: "PROSTI BROJEVI NA DATOM INTERVALU" - REŠENJE

#include <iostream>

using namespace std;
bool isProst(long long b){
    if(b==1 || b==2)return true;
bool r=true;

    long d=2;
while(b%d!=0 ){
        d++;
    }
    if(d<b)r=false;
return r;
}

//početak
int main()
{
long long a, b ,c=0;
    cin >> a >> b;
for(int i=a; i <= b; i++)
    {
if(isProst(i))
        {
            cout<<i<<"   ";
            c++;
            if(c%10==0)cout<<endl;
        }

    }
return 0;
}