Walking problem
Здравейте,
Имам малък проблем със задачата " Стъпки ", получавам 70/100 и не мога да си намеря проблема. Ще съм благодарен ако някой ми помогне.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string decision; int steps, total_s = 0, w_steps = 0;
cin >> steps;
cin.ignore();
while (steps < 10000)
{
getline(cin, decision);
if (decision == "Going home")
{
cin >> steps;
steps += w_steps;
if (steps < 10000)
{
break;
}
}
else {
int s = stoi(decision); steps += s;
}
}
if (steps >= 10000)
{
cout << "Goal reached! Good job!";
}
else if (steps < 10000)
{
cout << 10000 - steps << " more steps to reach goal.";
}
}
In any case, the expression is real: structure a strong suggestion and procedure explanation and your work will "remain in contact with itself." Plan to contribute some essentialness making and re-trying and modifying (once more) your proposal and framework verbalizations so you will know where you are going and where you have to go.
By: https://articleoftheweek.com/2020/01/26/what-is-comptia-cdia-certification/