Quick actions

cmd+k|ctrl+k

Navigation

Languages

Самостоятельная работа 5 №4

Snippet info

Language

Cpp

Visibility

public

Author

dimonkoko1

Created

2018-10-06T12:52:22Z

Updated

2018-10-14T11:02:00Z

#include <iostream>
using namespace std;

int main() {
	///////////////////////////////////////////////////////////// Задание №4 Вариант 115 ///////////////////////////////////////////////////////
	setlocale(LC_ALL, "");

	int grants, parental_help, total_help;
	double costs;

	total_help = 0;

	cout << "Введите стипендию которую вы получаете(в гривнах):" << endl;
	cin >> grants;
	cout << "Введите ежемесячный расход превышающий стипендию(в гривнах):" << endl;
	cin >> costs;



	for (int i = 1; i <= 10; i++) {
		costs = costs + costs * 0.03;
		parental_help = costs - grants;
		total_help = total_help + parental_help;


		cout << "Расходы в месяц : " << costs << " грн." << endl;
		cout << "Сколько нужно попросить у родителей : " << parental_help << " грн." << endl << endl;

		if (i == 10)
			cout << "Вам нужно выпросить " << total_help << " грн." << endl;
	}

	return 0;
}
INFO