package work_oc;
import java.util.Scanner;
public class work_1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("请输入圆的半径(r>0)");
Scanner si=new Scanner(System.in);
float r=si.nextFloat()
float s;
s=r*r*3.14F;
System.out.println("该圆的半径为:"+s);
}
}
package work_oc;
public class work_2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
double hua=50;
hua=(hua-32)*5/9;
double she=30;
she=she*9/5+32;
System.out.println("50度华氏温度转化为摄氏度的结果为:"+hua);
System.out.println("30度摄氏温度转化为华氏度的结果为:"+she);
}
}
package work_oc;
public class work_3 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a=5;
int b=8;
int c;
System.out.println("交换前a,b的值分别为"+a+"和"+b);
c=a;
a=b;
b=c;
System.out.println("交换后a,b的值分别为"+a+"和"+b);
}
}
package work_oc;
public class work_4 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int n=12141;
System.out.println("五位数为:"+n);
int a;
a=n-(n%100);
System.out.println("保留至百位后:"+a);
}
}
package work_oc;
public class work_5 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a=1234;
System.out.println("其各位数总和为\n");
int b,c,d,e;
b=a/1000;
e=a%10;
c=a/100-b*10;
d=(a%100-e)/10;
System.out.println(b+c+d+e);
}
}
package work_oc;
public class work_6 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int field='A';
System.out.println("其小写为");
field=field+32;
System.out.println((char)field);
}
}