import java.util.*;
public class first{
public static void main(String[]args){
Scanner input=new Scanner(System.in);
System.out.println("-------银行存款-------");
System.out.println("你要存多少钱(¥):");
double money=input.nextDouble();
System.out.println("你要存多少年?");
int year=input.nextInt();
double i=0.003;
double corpus=0 ;
for(int j=0;j<=year;j++){
corpus =corpus +((money+corpus )*i+money);
}
System.out.println(year+"年后的本金为:"+corpus );
}
}
网友评论