第一次上机作业

package set;

public class dic {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	
int a =100;  int b=200;
int c;
c=a;
a=b;
b=c;
System.out.println("a的值是"+a+"b的值是"+b);

}
}

  

 

 

import java.util.Scanner;

public class dic {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	
      System.out.println("请输入一个人1~1000的整数");
      Scanner sc = new Scanner (System.in);
      int a =sc.nextInt();
      int b,c,d,e,m;
      e=a/1000;
      b=a/100%10;
      c=a/10%10;
      d=a%10;
      m=b+c+d+e;
      System.out.println("结果为"+m);
	}
}

  

 

 

package set;

import java.util.Scanner;

public class dic {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
     double a= 100;
     double b=37;
     System.out.println((a-32.0)*5/9);
     System.out.println(b*9.0/5+32);
	}
}

  

 

 

package set;

import java.util.Scanner;

public class dic {

	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:11  Demens  阅读(74)  评论(0编辑  收藏  举报