Witam!
Napisałem taki program:
#include<iostream>
using namespace std;
int main()
{
int l,w;
cin>>l;
while(l<=900)
{
srand(time(NULL));
w=rand()%900+1;
l+=w;
cout<<w<<endl;
}
system("pause");
return 0;
}
Problem w tym, że nie wiem jak zrobić, żeby program znajdywał 9 kolejnych liczb naturalnych, których suma wynosi 900, dlatego proszę Was o pomoc.