第二周上机练习

public class qwe {
 
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
     int r=2;
     double π=3.14;
     System.out.println(r*r*π);
    }
 
}

public class five {
    public static void main(String[] args){
        int a=123;
        int b,c,d,e,sum;
        b=a/1000;
        c=a/100%10;
        d=a/10%10;
        e=a%10;
        sum=b+c+d+e;
        System.out.println(sum);
    }
}

int a=5,b=8;
    int c;
    
        c=a;
         a=b;
         b=c;
        
        System.out.println(a);
        
        System.out.println(b);

int a=12345,b;
        b=a/100*100;
        System.out.println(b);

package zy2;

public class Test2 {

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

package zy2;

public class Test2 {

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

posted @ 2021-03-14 18:05  五谷鸡爪🥳  阅读(35)  评论(0编辑  收藏  举报