You are viewing a single comment's thread. Return to all comments →
Finally passed test case 6 with this, although I'm still not sure why. Is there any way to get a look at the test cases?
int main() { int chapters{0}, problemsPerPage{0}, problemsInChapter{0}, pageNumber{0}, specials{0};
cin >> chapters >> problemsPerPage; while (cin >> problemsInChapter) for (int problemNumber{0}; problemNumber < problemsInChapter; ++problemNumber) { if (problemNumber % problemsPerPage == 0) ++pageNumber; if (problemNumber + 1 == pageNumber) ++specials; } cout << specials; return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Lisa's Workbook
You are viewing a single comment's thread. Return to all comments →
Finally passed test case 6 with this, although I'm still not sure why. Is there any way to get a look at the test cases?
int main() { int chapters{0}, problemsPerPage{0}, problemsInChapter{0}, pageNumber{0}, specials{0};
}