eolymp
bolt
Try our new interface for solving problems
published at 1/25/24, 3:24:08 pm

include<iostream>

include<cmath>

include<algorithm>

using namespace std; int main() { long long a=1,k; cin>>k; while(k!=0) { if(a%2!=0 && a%3!=0 && a%5!=0) { cout<<a<<' '; k--; } a++; } return 0; }

published at 2/8/24, 8:01:06 pm

n=int(input()) i=1 k=0 while i!=n+1: if k%2!=0 and k%3!=0 and k%5!=0: i+=1 print(k,end=' ') k+=1

published at 4/8/24, 6:45:32 pm

include <iostream>

using namespace std; int main() { int n; std::cin>>n;

int say=0;
int num=1;

while (say<n) {
    if (num%2!=0 && num%3!=0 && num%5!=0) {
        std::cout<<num<<" ";
       say++;
    }
    num++;
}

return 0;

}

published at 4/12/24, 3:17:28 pm

include<iostream>

include<cmath>

include<algorithm>

using namespace std; int main() { long long a=1,k; cin>>k; while(k!=0) { if(a%2!=0 && a%3!=0 && a%5!=0) { cout<<a<<' '; k--; } a++; } return 0; }