Dzień Dobry. W jaki sposób mogę zsumować wyświetlane liczby?
#include <iostream>
using namespace std;
int main()
{
float x;
cin >> x;
if(x==0)
{
return 0;
}
for(float n=1;x; n++)
{
cout << 1/(n) << endl;
system("pause");
if(n>=x)
{
return 0;
}
}
return 0;
}