Daphne má úrok 10%, Cleo 5%
PROČ TO NEJDE?
Kód: Vybrat vše
#include <iostream>
int main()
{
using namespace std;
double daphne = 100 ;
double cleo = 100;
double interest_daphne = 0.10 * daphne;
double interest_cleo = 0.05 * cleo;
int years = 0;
while (cleo <= daphne)
{
daphne += interest_daphne;
cleo += interest_cleo;
++ years;
cout << cleo << " " << daphne << endl;
}
cout << cleo << " " << daphne << endl;
cout << years;
return 0;
}
