Guest User

Untitled

a guest
Oct 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <math.h>
  4. #include <iostream>
  5. using namespace std;
  6.  
  7.  
  8. int main() {
  9. setlocale(LC_ALL, "Russian");
  10.  
  11. double l, h, p, sum, roll;
  12. cout << "Введите длину стены: "; // Длина
  13. if (!(cin >> l)) {
  14. cout << "Неверный ввод";
  15. return 0;
  16. };
  17. cout << "Введите высоту стены: "; // Высота
  18. if (!(cin >> h)) {
  19. cout << "Неверный ввод";
  20. return 0;
  21. };
  22. cout << "Введите цену за рулон: "; // Цена рулона
  23. if (!(cin >> p)) {
  24. cout << "Неверный ввод";
  25. return 0;
  26. };
  27.  
  28. roll = ceil((l * h) / 12); // Сколько рулонов надо
  29. sum = roll * p; // Сколько денег надо
  30. cout << "Надо купить рулонов: " << sum << endl;
Add Comment
Please, Sign In to add comment