Get the App
SLTechnology News&Howtos  ›  Development  › 

Case coding Analysis of C++

Shulou Source: shulou.com Published: 2022-06-02 03:47:46 09月24日 Update

In this article, the editor introduces "C++ case coding analysis" in detail, with detailed contents, clear steps and proper handling of details. I hope this "C++ case coding analysis" article can help you solve your doubts. Let's follow the editor's train of thought to slowly deepen, let's learn new knowledge.

Total time limit: 1000ms memory limit: 65536kB

Description

Farmer John made a lot of money last year! He wants to invest the money.

And curious about how much they can get.

The compound annual interest rate for known investments is R (an integer between 0 and 20).

John has money with a total value of M (an integer between 100 and 1000000).

He knows very well that he is going to invest in Y years (range from 0 to 400).

Please help him calculate how much money he will have in the end, and output the integer part of it.

The data ensures that the output is within the range of 32-bit signed integers.

Input

A line contains three integers R _ ~ Y, and two adjacent integers are separated by a single space.

Output

An integer, that is, how much money John finally has (the integer part).

Sample input

5 5000 4

Sample output

6077

Prompt

In the sample

After the first year: 1.05 * 5000 = 5250

After the second year: 1.05 * 5250 = 5512.5

After the third year: 1.05 * 5512.50 = 5788.125

After the fourth year: 1.05 * 5788.125 = 6077.53125

The integer portion of 6077.53125 is 6077.

Source

USACO 2004 November

, /

# include

Using namespace std

Int main ()

{

Int r,m,y

Cin > > r > > m > > y

Double x

Xampm

For (int iTunes 1)

Tags: Integers outputs instances coding caching analysis between articles John investments content scope parts help input restrictions propriety clarity curiosity one line Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Huawei macOS MySQL Xiaomi