Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- using namespace std;
- #include <iomanip>
- int main()
- {
- int lenght;
- do
- {
- cin.clear();
- cin >> lenght;
- }
- while (cin.bad() || lenght <10 || lenght > 500);
- int width;
- {
- cin.clear();
- cin >> width;
- }
- while (cin.bad() || width < 10 || width > 300);
- int height;
- do
- {
- cin.clear();
- cin >> height;
- }
- while (cin.bad() || height < 10 || height > 500);
- double percent;
- do
- {
- cin.clear(); cin >> percent;
- }
- while (cin.bad() || percent < 0 || percent > 100);
- double capacity = (lenght * width * height) * 0.001;
- double free = (capacity - (capacity * percent / 100));
- cout << fixed << setprecision(3) << free << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement