close
public class JVA02
{
public static void main(String args[])
{
double p = 1000;
double r = 0.05;
double a,b;
System.out.println("年 A銀行(複利) B銀行(單利)");
System.out.println("-------------------------------------");
for(int n = 1; n {
a = p * Math.pow(1 + r, n);
b = p * (1 + n * r);
System.out.println(n + "\t" + Math.round(a) + "\t\t" + Math.round(b));
}
}
}
全站熱搜