Interest (1)

Given an initial capital c in euros, an annual interest rate i
(expressed in %), a time t in years and an indication whether the
interest is simple or compound, determine the amount of euros the
initial capital is transformed into.

Input

The input consists of two strictly positive real numbers c and i,
followed by a strictly positive integer t, followed by either the word
“simple” or the word “compound”.

Output

Write the final capital with 4 decimal places.

Observation

If you program in C++, use the double data type and put these two lines
at the beginning of your main():

        cout.setf(ios::fixed);
        cout.precision(4);

Problem information

Author: Unknown
Translator: Gabriel Valiente

Generation: 2026-01-25T12:05:48.738Z

© Jutge.org, 2006–2026.
https://jutge.org
