第二次作业

1.public class text2 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int r=4;
double s=3.14*r*r;
System.out.println("圆的面积是"+s);
}

}

 2. 

      

public class text2 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double h=99;
double a1=h-32;
double a=a1*5/9;
double s=34;
double b1=s*9/5;
double b=b1+32;
System.out.println("华氏温度为99摄氏度"+a+"摄氏温度为34华氏温度"+b);
}

}

 

 

3. 

public class text2 {

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

}

 

 

 

4.

public class text2 {

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

}

}

 

 5.  

public class text2 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int zhengshu=1234,sum;
sum=(zhengshu%10)+(zhengshu%100/10)+(zhengshu%1000/100)+(zhengshu/1000);
System.out.println(sum);

}

 

 6.  

         


public class text2 {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int zhengshu=1234,sum;
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-14 18:40  吴宁  阅读(21)  评论(0编辑  收藏  举报