#include <iostream>
usingnamespace std;
int main()
{
int n, nr, nrfin;
cout << "Introduceti numarul natural n.\n";
cin>>nr;
cout << "Introduceti un numar natural.\n";
cin>>n;
while (n%1==0 || n%3==0 || n%5==0 || n%7==0 || n%9==0)
{
if (n>=0)
{
if (nr>=0)
{
if(n<nr&&n%3==0)
{
nrfin++;
}
}
else
{
return 0;
}
}
else
{
return 0;
}
cin >>n;
}
cout <<nrfin;
return 0;
}
Basically I want my program to keep inputting a number (nr) greater than or equal to 0, then keep inputting numbers until an even number is inputted, at which point it needs to sort out all the numbers inputted and print the ones that are less than nr and are divisible by 3.