假設欠錢100萬,年利率為r=6%,複利計算5, 10, 15,20, 25, 30,35,40年後連本帶利還錢,應還多少錢?
循環複利計算公式為A=P*exp(r*t),A=本利和,P=本金,t=年數。
herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
先說明一下這是後知後覺的解答,所謂後知就是股票價格已知存在陣列(清單),當然就要用迴圈練習,雙迴圈暴力解需時O(n**2),當然不用,採python單一迴圈解答「最佳股票的買賣時機#LeetCode 121 Best Time to Buy and Sell Stock」,解...
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
你會用C的算子sizeof?
-
Python C++使用字串find迴圈速解Leetcode 2490 Circular Sentence C++ & Python都有字串的find,用法都類似 split=s.find(' ', split+1)能找到s從index=split+1開...
-
Python CPP heap priority queue速解L eetcode 2530. Maximal Score After Applying K Operations heap/priority queue是重要的資料結構,無論是C++的std::priority_q...
53 則留言:
import java.util.*;
import java.lang.*;
import java.io.*;
class exp
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還:"+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
public class D10033003 {
public static void t(int x){
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
int t=x;
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
public static void main(String[] args) {
t(5);
t(10);
t(15);
t(20);
t(25);
t(30);
t(35);
t(40);
}
}
public class BADBOY {
public static void t(int x) {
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
int t=x;
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
public static void main(String[] args) {
t(5);
t(10);
t(15);
t(20);
t(25);
t(30);
t(35);
t(40);
}
}
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class forFun
{
public static void main (String[] args) throws java.lang.Exception
{
double P=2000000.0;
double r=0.05;
System.out.println("欠二百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);}
}
}
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class forFun
{
public static void main (String[] args) throws java.lang.Exception
{
double P=2000000.0;
double r=0.05;
System.out.println("欠二百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class forFun
{
public static void main (String[] args) throws java.lang.Exception
{
double P=2000000.0;
double r=0.05;
System.out.println("欠二百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);}
}
}
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class forFun
{
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class forFun
{
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class forFun
{
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
// TODO Auto-generated method stub
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class forFun
{
public static void t(int x){
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
int t=x;
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
public static void main(String[] args){
t(5);
t(10);
t(15);
t(20);
t(25);
t(30);
t(35);
t(40);
}
}
class years
{
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<=40;t+=5)
{
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
package hello;
import java.util.Scanner;
public class hi0330 {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
package hey;
import java.util.Scanner;
public class hi {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
D10333045黃崇玨
package hello;
import java.util.Scanner;
public class hi {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
D10333007 馮婷鈺
public class hi {
public static void main(String[] args) {
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
package hello;
import java.util.Scanner;
public class hi {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
D10333040王崇安
import java.util.*;
import java.lang.*;
import java.io.*;
class exp
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還: "+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
D10333034 洪芷茵
import java.util.*;
import java.lang.*;
import java.io.*;
class forFun
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還: "+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
D10333033江淑婷
import java.util.*;
import java.lang.*;
import java.io.*;
class exp
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還: "+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
package hI;
import java.util.Scanner;
public class HELLO {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 50;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
public class apt {
public static void main(String[] args) {
// TODO Auto-generated method stub
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
int t=5;
int u=10;
int v=15;
int w=20;
int x=25;
int y=30;
int z=35;
int s=40;
double A=P*Math.exp(r*t);
double B=P*Math.exp(r*u);
double C=P*Math.exp(r*v);
double D=P*Math.exp(r*w);
double E=P*Math.exp(r*x);
double F=P*Math.exp(r*y);
double G=P*Math.exp(r*z);
double H=P*Math.exp(r*s);
System.out.println(t+"年後要還"+A);
System.out.println(u+"年後要還"+B);
System.out.println(v+"年後要還"+C);
System.out.println(w+"年後要還"+D);
System.out.println(x+"年後要還"+E);
System.out.println(y+"年後要還"+F);
System.out.println(z+"年後要還"+G);
System.out.println(s+"年後要還"+H);
}
}
package hI;
import java.util.Scanner;
public class HELLO {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 50;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
class forFun
{
public static void main (String[] args)
{
for(int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還:"+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
class exp
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還:"+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
package hey;
import java.util.Scanner;
public class hi {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
package hi;
import java.util.Scanner;
public class hi2 {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 50;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
package hello;
import java.util.Scanner;
public class hi {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
public class hello {
public static void main (String[] args)
{
System.out.println("欠一百萬");
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年後要還"+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
D10333010 柯羿瑄
import java.util.*;
import java.lang.*;
import java.io.*;
class forFun
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還: "+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
public class hi1 {
public static void main (String[] args)
{
for (int i = 5; i <=40; i+=5)
System.out.println("第"+i + "年後要還: "+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
d10033301江姿穎
package kelly0330;
public class kelly0330 {
public static void t(int x){
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
int t=x;
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
public static void main (String[] args){
t(5);
t(10);
t(15);
t(20);
t(25);
t(30);
t(35);
t(40);
}
}
package hi;
import java.util.Scanner;
public class hi2 {
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 50;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
public class HI2 {
public static void main(String[] args) {
double P = 1000000.0;
double r = 0.06;
System.out.println("欠一百萬");
for (int t=5;t<45;t=t+5){
double A = P * Math.exp(r * t);
System.out.println(t + "年後要還" + A);
}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
public class hi {
public static void main(String[] args) {
double P=1000000.0;
double r=0.07;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
package jones;
import java.util.Scanner;
public class joneswang{
public static void main (String[] args) throws java.lang.Exception
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 50;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
public class wawa {
public static void main(String[] args) {
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
public class gg {
public static void main(String[] args) {
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
class Hello
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還: "+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
class luo1
{
public static void main(String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還:"+exp(i)+"元");
}
static double exp(int t)
{
double p=1000000.0;
double r=0.06;
double A=p*Math.exp(r*t);
return A;
}
}
public class B10033104 {
public static void main(String[]args{
// TODO Auto-generated method stub
double P = 1000000.0;
double r = 0.06;
System.out.println("欠一百萬");
for (int t = 5; t < 41; t = t + 5) {
double A = P * Math.exp(r * t);
System.out.println(t + "年後要還" +A);
}
}
}
package joneswang;
public class joneswang1314 {
public static void main(String[] args) {
// TODO Auto-generated method stub
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
package joneswang;
public class joneswang1314 {
public static void main(String[] args) {
// TODO Auto-generated method stub
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5 ; t < 45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
public class hi {
public static void main (String[] args)
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5;t < 45;t =t + 5 ){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);}
}
}
public class hi1 {
public static void main (String[] args)
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<=40;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
public class hi {
public static void main (String[] args)
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for (int t = 5;t < 45;t =t + 5 ){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);}
}
}
class forFun
{
public static void t(int x){
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
int t=x;
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
public static void main(String[] args){
t(5);t(10);t(15);t(20);t(25);t(30);t(35);t(40);
}
}
public class hi1 {
public static void main (String[] args)
{
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<=40;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
class ex2
{
public static void main (String[] args)
{
for(int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還: "+exp(i)+"元");
}
static double exp(int t)
{
double p=1000000.0;
double r=0.06;
double A=p*Math.exp(r*t);
return A;
}
}
public class D10333024 {
public static void main (String[] args)
{
System.out.println("欠一百萬");
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年後要還"+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
class Hello
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還: "+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
y10310066 陳昤瑄
public class hi {
public static void main(String[] args) {
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
import java.util.*;
import java.lang.*;
import java.io.*;
class exp
{
public static void main (String[] args)
{
for (int i=5;i<=40;i+=5)
System.out.println("第"+i+"年要還:"+exp(i)+"元");
}
static double exp(int t)
{
double P=1000000.0;
double r=0.06;
double A=P*Math.exp(r*t);
return A;
}
}
public class hi {
public static void main(String[] args) {
double P=1000000.0;
double r=0.06;
System.out.println("欠一百萬");
for(int t=5;t<45;t=t+5){
double A=P*Math.exp(r*t);
System.out.println(t+"年後要還"+A);
}
}
}
張貼留言