알 수 없는 사용자 2014. 4. 8. 16:28

using UnityEngine;

using System.Collections;


public class ExBank3 : MonoBehaviour {


// Use this for initialization

void Start () {

int deposit = 1000000000;

int year = 10;

int total = GetDeposit1(deposit, 10, 5);

print ("Deposit =" + deposit + ", Total=" + total + ", Year = " + year);

}

int GetDeposit1(int deposit, int year, int percent) {

int total = deposit;

for(int i = 0; i < year; i++){

total = total + deposit * percent / 100;

print (total);

}

return total;

}

// Update is called once per frame

void Update () {

}

}