HelloWorld hello = new HelloWorld();
int[] scores={79,52,98,81};
int count=hello.sort(scores);
System.out.println("共有"+count+"个成绩信息!");
}
public int sort(int scores[] ){
Arrays.sort(scores);
System.out.println(Arrays.toString(scores));
return scores.length;
}
}
int[] scores={79,52,98,81};
int count=hello.sort(scores);
System.out.println("共有"+count+"个成绩信息!");
}
public int sort(int scores[] ){
Arrays.sort(scores);
System.out.println(Arrays.toString(scores));
return scores.length;
}
}
2015-06-01
int a=24;
int b=18;
int c=36;
int d=27;
int sum=a+b+c+d;
double avg=(a+b+c+d)/4;
int minus=a-b;
int newAge=--a;
System.out.println("年龄总和:"+sum);
System.out.println("平均年龄:"+avg);
System.out.println("年龄差值:"+minus);
System.out.println("自减后的年龄:"+newAge);
int b=18;
int c=36;
int d=27;
int sum=a+b+c+d;
double avg=(a+b+c+d)/4;
int minus=a-b;
int newAge=--a;
System.out.println("年龄总和:"+sum);
System.out.println("平均年龄:"+avg);
System.out.println("年龄差值:"+minus);
System.out.println("自减后的年龄:"+newAge);
2015-05-30
public class HelloWorld{
public static void main(String[] args) {
final String NO="男";
final String YOU="女";
System.out.println(YOU);
System.out.println(NO);
}
}
public static void main(String[] args) {
final String NO="男";
final String YOU="女";
System.out.println(YOU);
System.out.println(NO);
}
}
2015-05-30
public class HelloWorld{
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
double avg2=avg1+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
public static void main(String[] args) {
double avg1=78.5;
int rise=5;
double avg2=avg1+rise;
System.out.println("考试平均分:"+avg1);
System.out.println("调整后的平均分:"+avg2);
}
}
2015-05-30
int sum=age1+age2+age3+age4;
double avg=(age1+age2+age3+age4)/4;
int minus=age1-age2;
int newAge=--age1;
System.out.println("年龄总和:"+sum);
System.out.println("平均年龄:"+avg);
System.out.println("年龄差值:"+minus);
System.out.println("自减后的年龄:"+newAge);
}
}
double avg=(age1+age2+age3+age4)/4;
int minus=age1-age2;
int newAge=--age1;
System.out.println("年龄总和:"+sum);
System.out.println("平均年龄:"+avg);
System.out.println("年龄差值:"+minus);
System.out.println("自减后的年龄:"+newAge);
}
}
2015-05-30