Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Задание 1. Про кроликов
- */
- #include <iostream>
- #include <locale>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "Russian");
- double food_cost = 0;
- cin >> food_cost;
- const double cost_of_the_rabbit = food_cost + (food_cost / 100 * 30);
- double store_commission = cost_of_the_rabbit / 4;
- double profit_from_one_rabbit = cost_of_the_rabbit - store_commission;
- size_t rabbits_count;
- cin >> rabbits_count;
- const int FIFTEEN_THOUSAND = 15'000;
- if (cost_of_the_rabbit * rabbits_count < FIFTEEN_THOUSAND) {
- cout << "Число кроликов = " << rabbits_count << ", они бдут стоить " << cost_of_the_rabbit * rabbits_count << " рублей.";
- } else {
- cout << "СЛИШКОМ МНОГО КРОЛИКОВ!";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement