public static void money(){
Scanner input = new Scanner(System.in);
float l = input.nextFloat();//利率
float r = l/100 + 1;
float m = input.nextFloat();//本金
int year = input.nextInt();
float total = m;
int i = 0;
do {
total = total * r;
i++;
}while (i<year);
System.out.println(total);
System.out.println((int)total);
}
JAVA function5
最新推荐文章于 2023-12-25 20:13:18 发布