第一次上机作业

1.
package chap1;

public class Main {
    public static void main(String[] args)
    {
        int  a=1;
        int  b=2;
        int temp = a;
        a = b; 
        b=temp;
        System.out.println(a+" "+b);
    }
}
2. package chap1;

public class Main {
    public static void main(String[] args)
    {
        int  a=12;
        int  x=12%10;
        int  y=12/10;
        int  sum=x+y;
        System.out.println("sum="+sum);
    }
}
package chap1;

public class Main {
    public static void main(String[] args)
    {
        int  a=0005;
        int  b=0005%10;
        System.out.println("  "+b);
    }
}
3. package chap1;

public class Main {
    public static void main(String[] args)
    {
        int  a=50;
        int  b=(a-32)*5/9;
        System.out.println("华氏度="+b);
    }
}
4. package chap1;

public class Main {
    public static void main(String[] args)
    {
        char  a='A';
        System.out.println((char)(a+32));
    }
}

posted @ 2020-03-19 12:07  谁在二堂喧哗  阅读(70)  评论(0编辑  收藏  举报