public class TQC202
{
public static void main(String args[])
{
//在此處加上原始碼
double r=0.05;
int p = 1000;
int n = 10;
int m1,m2;
System.out.println("年 A銀行(複利) B銀行(單利)");
System.out.println("----------------------------------------");
for(int i = 1; i <= n ; i++)
{
//這邊自己寫.....
}
System.out.println("----------------------------------------");
}
}作者: rogercheng0119 時間: 2012-1-14 19:33
class d120114_2{
public static void main(String args[]){
double r=0.05;
int p = 1000;
int n = 10;
int m1,m2;
System.out.println("年 A銀行(複利) B銀行(單利)\n----------------------------------------");
for(int i = 1; i <= n ; i++){
m1 = (int)(p * Math.pow( (1+r) , i ));
m2 = (int)(p * ( 1 + r*i ));
System.out.printf("%d\t%d\t\t%d\n",i,m1,m2);
}
System.out.println("----------------------------------------");
}
}作者: rogercheng0119 時間: 2012-1-14 19:33
class d120114_2{
public static void main(String args[]){
double r=0.05;
int p = 1000;
int n = 10;
int m1,m2;
System.out.println("年 A銀行(複利) B銀行(單利)\n----------------------------------------");
for(int i = 1; i <= n ; i++){
m1 = (int)(p * Math.pow( (1+r) , i ));
m2 = (int)(p * ( 1 + r*i ));
System.out.printf("%d\t%d\t\t%d\n",i,m1,m2);
}
System.out.println("----------------------------------------");
}
}作者: p17johnny 時間: 2012-1-14 20:08