java第二周作业

package shangji;

public class dierzhang {

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

    }

}

package shangji;

public class dierzhang {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
double hua=50;
System.out.println(hua-32*5/9);

    }

}
package shangji;

public class dierzhang {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
double she=30;
System.out.println(she*5/9+32);

    }

}

package shangji;

public class dierzhang {

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

}

package shangji;

public class dierzhang {

    public static void main(String[] args) {
        // TODO Auto-generated method s
         int shu=12345,baiwei;
            baiwei=shu/100*100;
            System.out.println(baiwei);
            
    }

}

package shangji;

public class dierzhang {

    public static void main(String[] args) {
        // TODO Auto-generated method s
         int shu=2580,sum;
         sum=(shu%10)+(shu%100/10)+(shu%1000/100)+(shu/1000);
            System.out.println(sum);
            
    }

}

package shangji;

public class dierzhang {

    public static void main(String[] args) {
        // TODO Auto-generated method s
         char daxie,xiaoxie,shuchu;
            daxie='A';
            shuchu=(char) (daxie+32);
            System.out.println(shuchu);
            xiaoxie='a';
            shuchu=(char) (xiaoxie-32);
            System.out.println(shuchu);
            
    }

}

posted @ 2021-03-12 09:57  杨英斌  阅读(42)  评论(0编辑  收藏  举报