DilyaraL

Untitled

Apr 4th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void read_and_write()
  5. {
  6. int k, m, d,s=1, books=0;
  7. cin >> k >> m >> d;
  8. int kdays = d;
  9. if (d < 6)
  10. books = k + m-s;
  11. else
  12. books = m-s;
  13. while (books >= 0)
  14. {
  15. kdays++;
  16. s++;
  17. if (kdays%8 < 6)
  18. books = k + books-s;
  19. else
  20. books = books - s;
  21. }
  22. cout << kdays - d<< endl;
  23. }
  24. int main()
  25. {
  26. read_and_write();
  27. system("pause");
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment