public class investment {
public static void main(String args[]){
int i=0;
Scanner Pay = new Scanner(System.in);
System.out.print("how many years do u want to put in the money for? ");
int years = Pay.nextInt();
Scanner Py = new Scanner(System.in);
System.out.print("how much do u want to invest? ");
double money = Py.nextDouble();
while (i<=years){
i++;
double pr=.10;
double finall=(money*pr)+money;
System.out.print(finall);
}
}
}
爲什麼打印一個ip地址而不是一個合法的號碼?我如何讓java添加而不是cancentate?
一個IP地址? –
它打印的是什麼? – chessbot
'+ ='或'++'或'+'添加? – Tdorno