Untitled

mail@pastecode.io avatar
unknown
c_cpp
6 months ago
461 B
1
Indexable
Never
#include <iostream>
using namespace std;

int main() {
	setlocale(LC_ALL, "Russian");
	int n, m, l, k, a, b = 0;
	cout << "Количество белой бумаги: ";
	cin >> n;
	cout << "Синей: ";
	cin >> m;
	cout << "Белой: ";
	cin >> l;
	cout << "Количество досок: ";
	cin >> k;
	a = k * 2;
	if (n < a) {
		b += (a - n);
	}
	if (m < a) {
		b += (a - m);
	}
	if (l < a) {
		b += (a - l);
	}
	cout << b;
}
Leave a Comment