1. 输入三个數A B C , 从大到小排列 
2. 一个球 从10米高落到地下  反弹1/2高 又落下 又反弹1/2高  请问 十次以后 球高度是多少
3. 还是1!+2!+3!+....+20!
4. 输出 9*9 口诀
5  算出2/1 + 3/2 + 5/3 + 8/5 + 13/8 ++ 的和

解决方案 »

  1.   

    哈哈,今天有空,顺便写写
    1)
    public class Taxis { /**
     * @param args
     */
    public static void main(String[] args) {
    Scanner in=new Scanner(System.in);

     double a=in.nextDouble();
     double b=in.nextDouble();
     double c=in.nextDouble();
     double t;
     
     if(a<b) 
           {t=a;a=b;b=t;} 
         if(a<c)
           {t=a;a=c;c=t;} 
         if(b<c)           
           {t=b;b=c;c=t;}
         System.out.println(a+">"+b+">"+c);
     


    }}
      

  2.   

    2)
    public class Height { /**
     * @param args
     */
    public static void main(String[] args) {
    double height=10;
    int time=10;
    double newHeight=height*Math.pow(0.5, time);
    System.out.println("After 10 times ,the newHeight:"+newHeight);

    }
    }
      

  3.   

    3)
    public class Factorial_Sum { /**
     * @param args
     */
    public static void main(String[] args) {
    long sum=0;
    for(int i=1;i<=20;i++){
    sum+=factorial(i);
    }
    System.out.println(sum);
    }  public static long factorial(int n){
     long sum=1;
     for(int i=1;i<=n;i++){
     sum*=i;
     }
     return sum;
     }
    }
      

  4.   

    第一题import java.util.*;
    class SortThreeNumbers{
      public static void main(String[] args){
        if(args.length==0){
         System.out.println("useage: java SortThreeNumbers xx xx xx");
         System.exit(0);
        }
        int[] a=new int[args.length];
        
        for(int i=0;i<args.length;i++){
         a[i]=Integer.parseInt(args[i]);
        
        }
        Arrays.sort(a);
        for(int i=0;i<a.length;i++){
         System.out.println(a[i]);
        
        }
        
        
        
      }
    }
      

  5.   

    class suanfa
    {
    //输入 a b c ,从大到小排列
    public static void sort()
    {
    try
    {
    int a,b,c,temp;
    System.out.println("请输入数");
    a = System.in.read();
    b = System.in.read();
    c = System.in.read();
    if(a<b)
    {
    temp = a;
    a = b;
    b = temp;
    }
    if(a<c)
    {
    temp = a;
    a = c;
    c = temp;
    }
    if(b<c)
    {
    temp = b;
    b = c;
    c = temp;
    }
    System.out.println((a-48) +","+(b-48)+","+(c-48) );
    }
    catch(Exception e){}

    }

    //输出9*9
    public static void prt()
    {
    for(int i=1;i<10;i++)
    {
    for(int j=i;j<10;j++)
    {
    System.out.print(i+"*"+j+"="+i*j+" ");
    }
    System.out.println();
    }
    }



    public static void main(String [] args)
    {
    //sort();
    prt();
    }
    }