第一次上机作业

package the;

public class world {
public static void main(String[] args) {
int a=2,b=3;
int c=0;
System.out.println("互换前:a="+a+" "+"b="+b);
a=c;
a=b;
b=c;
System.out.println("互换后:a="+a+" "+"b="+b);
}

}

 

 

package the;

public class world {
public static void main(String[] args) {
int s=369,a,b,c,sum;
System.out.println("定义一个数"+s);
a=s%10;
b=s/10%10;
c=s/100;
sum=a+b+c;
System.out.println("各位数的和为"+sum);
}

}

 

 

package the;

public class world {
public static void main(String[] args) {
int S,H;
S=37;
H=S*9/5+32;
System.out.println("当摄氏度为"+S+"则华氏度为"+H);
}

}

 

 

package the;

public class world {
public static void main(String[] args) {
char zf=68;
System.out.println("任意输出一个‘A’到‘Z’的字母"+zf);
if(zf>=65&&zf<=90){
zf+=32;
}
System.out.println("把它转换为小写字母"+zf);
}

}

 

posted @ 2020-03-19 12:12  仙下小妖  阅读(73)  评论(0编辑  收藏  举报