System.out.println("少年");
}else if(age>40){
System.out.println("中年");
}else if(age>60){
System.out.println("老年");
}else {
System.out.println("童年");
}else if(age>40){
System.out.println("中年");
}else if(age>60){
System.out.println("老年");
}else {
System.out.println("童年");
2015-05-26
System.out.println("a等于b:" + (a==b));
System.out.println("a大于b:" + (a>b));
System.out.println("a小于等于b:" + (a<=b));
System.out.println("str1等于str2:" + (str1==str2));
System.out.println("a大于b:" + (a>b));
System.out.println("a小于等于b:" + (a<=b));
System.out.println("str1等于str2:" + (str1==str2));
2015-05-26
three =one+two;
System.out.println("three = one + two ==> "+three);
three +=one;
System.out.println("three += one ==> "+three);
three -=one;
System.out.println("three -= one ==> "+three);
System.out.println("three = one + two ==> "+three);
three +=one;
System.out.println("three += one ==> "+three);
three -=one;
System.out.println("three -= one ==> "+three);
2015-05-26
int a=24;
int b=18;
int c=36;
int d=27;
int sum=a+b+c+d;
double avg=sum/4;
int minus=a-b;
int newAge=--a;
int b=18;
int c=36;
int d=27;
int sum=a+b+c+d;
double avg=sum/4;
int minus=a-b;
int newAge=--a;
2015-05-25
public class HelloWorld{
public static void main(String[] args) {
int a=12;
int b=24;
int sum=b+a;
System.out.println("两数之和为:"+sum);
}
}
为什么我的不+空格也能行啊int sum=b+a;
public static void main(String[] args) {
int a=12;
int b=24;
int sum=b+a;
System.out.println("两数之和为:"+sum);
}
}
为什么我的不+空格也能行啊int sum=b+a;
2015-05-25
public class HelloWorld {
public static void main(String[] args) {
int score = 94;
String sex = "女";
if (score>=80){
if (sex.equals("女")){
System.out.println("进入女子组决赛");}
else {
System.out.println("进入男子组决赛");} }
else {
System.out.println("淘汰");}}}
public static void main(String[] args) {
int score = 94;
String sex = "女";
if (score>=80){
if (sex.equals("女")){
System.out.println("进入女子组决赛");}
else {
System.out.println("进入男子组决赛");} }
else {
System.out.println("淘汰");}}}
2015-05-25
switch(today){
case'一':
case'三':
case'五':
System.out.println("早餐吃包子");
case'二':
case'四':
case'六':
System.out.println("早餐吃油条");
case'日':
System.out.println("吃主席套餐");
}
case'一':
case'三':
case'五':
System.out.println("早餐吃包子");
case'二':
case'四':
case'六':
System.out.println("早餐吃油条");
case'日':
System.out.println("吃主席套餐");
}
2015-05-25