第一次上机

第一题

package test;

public class hhh {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int a=1,b=2,c;
        c=a;
        a=b;
        b=c;
        System.out.println("a="+a);
        System.out.println("b="+b);

        

    }

}

  

 

 

第二题

package test;
 
public class hhh {
 
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int a=999;
        int b,c,d,e;
        b=a/100;
        c=a/10%10;
        d=(a-b*100)/10;
        e=d+b+c;
        System.out.println("和为"+e);
         
         
                 
    }
 
}

  

 

 

第三题

package test;
 
public class hhh {
 
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        int a=72,b=52,c,d;
        c=(a-32)*5/9;
        d=b*9/5+32;
        System.out.println("a的摄氏度为"+c);
        System.out.println("b的华氏度为"+d);
 
         
         
                 
    }
 
}
  

  

 

 

第四题

package test;
 
public class hhh {
 
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        char a='A';
 
        System.out.println((char)(a+32));
  
 
         
                 
    }
 
}
  

  

 

 

 
posted @ 2020-03-19 12:24  来咬我啊20675  阅读(88)  评论(0)    收藏  举报