Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int reachedHeight = 5364, days = 1, daylyHeight;
- string sleep;
- while (reachedHeight < 8848) {
- cin >> sleep;
- if (sleep == "END") {
- break;
- }
- else if (sleep == "Yes") {
- days++;
- if (days == 6) {
- break;
- }
- }
- cin >> daylyHeight;
- reachedHeight += daylyHeight;
- }
- if (reachedHeight >= 8848) {
- cout << "Goal reached for " << days << " days!\n";
- }
- else {
- cout << "Failed!\n" << reachedHeight << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement