Odpowiedź:
#include <iostream>
using namespace std;
int main()
{
srand(time(NULL));
int n;
cout<<"podaj n: "; cin >> n;
int suma=0,temp;
while(1){
temp = rand()%n + 100;
suma+=temp;
if (temp%10 == 0)
break;
if (temp%7 == 0)
cout << temp << ",";
}
cout << "\nsuma: " << suma;
return 0;
}