Java第二次作业

public class Qjh {

    /**
     * @param args
     */
    public static void main(String[] args) {
        double r = 6;
        double x = r * r * 3.14;
        System.out.println("当圆的半径是6时,圆的面积是" + x);// TODO Auto-generated method stub

    }

}

public class Qjh {

    /**
     * @param args
     */
    public static void main(String[] args) {
        double f = 50;
        double x =(f-32)/5*9;
        System.out.println("摄氏度是" + x);// TODO Auto-generated method stub

    }

}

 

 

 

public class Qjh {

    /**
     * @param args
     */
    public static void main(String[] args) {
        double c = 30;
        double x =c/9*5+32;
        System.out.println("华氏度是" + x);// TODO Auto-generated method stub

    }

}

 

 

public class Qjh {

    /**
     * @param args
     */
    public static void main(String[] args) {
        int a=5,b=8,c;
        c=a; a=b; b=c;
        System.out.println("a是" + a + "b是" + b);// TODO Auto-generated method stub

    }

}

 

 

public class Qjh {

    /**
     * @param args
     */
    public static void main(String[] args) {
        int a=12345 ;
        int b=12345/10000;
        int c=12345%10000/1000;
        int d=12345%1000/100;
        System.out.println(b*10000+c*1000+d*100);// TODO Auto-generated method stub

    }

}

 

 

public class Qjh {

    /**
     * @param args
     */
    public static void main(String[] args) {
        int a=1234/1000;
        int b=1234%1000/100;
        int c=1234%100/10;
        int d=1234%10;
        System.out.println(a+b+c+d);// TODO Auto-generated method stub

    }

}

 

 

public class Qjh {

    /**
     * @param args
     */
    public static void main(String[] args) {
        char c='A';
        System.out.println((char) ( c + 32));
        char d='a';
        System.out.println((char)(d-32));// TODO Auto-generated method stub
    }

}

 

posted @ 2021-03-14 21:27  医不活  阅读(40)  评论(0编辑  收藏  举报