Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int x, y, nonPaint;
- cin >> x >> y >> nonPaint;
- double neededPaint = 1.0 * x * y * 4 * (100.0 - nonPaint) / 100;
- string command;
- cin >> command;
- while (command != "Tired!") {
- neededPaint -= stoi(command);
- if (neededPaint <= 0) {
- break;
- }
- cin >> command;
- }
- if (neededPaint > 0) {
- cout << neededPaint << " quadratic m left.\n";
- }
- else if (neededPaint == 0) {
- cout << "All walls are painted! Great job, Pesho!\n";
- }
- else {
- cout << "All walls are painted and you have " << abs(neededPaint) << " l paint left!\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement