Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- ////////////////////////////////////////////////////
- int main()
- {
- int book = 0, price = 1000, sum = 0, i = 0;
- int count = 0;
- cout << "press enter counts book: ";
- cin >> book;
- while(i <= book)
- {
- switch (count)
- {
- case 0 : cout << i << " books = " << sum << '\n'; break;
- case 1 : price = 1000;
- sum += price;
- cout << i << " books = " << sum << '\n'; break;
- case 8 : price = 1000;
- sum += price;
- count = 1;
- cout << i << " books = " << sum << '\n'; break;
- default: price -= 55;
- sum += price;
- cout << i << " books = " << sum << '\n';
- }
- count++;
- i++;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement