• Source
    1. /* package whatever; // don't place package name! */
    2.  
    3. import java.util.*;
    4. import java.lang.*;
    5. import java.io.*;
    6.  
    7. /* Name of the class has to be "Main" only if the class is public. */
    8. class forFun
    9. {
    10. public static void main (String[] args) throws java.lang.Exception
    11. {
    12. double P=1000000.0;
    13. double r=0.07;
    14. System.out.println("欠一百萬");
    15. int t=10;
    16. double A=P*Math.exp(r*t);
    17. System.out.println(t+"年後要還"+A);
    18. }
    19. }