Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab5 4

Snippet info

Language

Cpp

Visibility

public

Author

enifmankalinan

Created

2018-12-03T21:36:19Z

Updated

2018-12-03T21:36:19Z

#include <iostream>
using namespace std;

int main() {
	
	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