for (int i = grade.length - 1; i > 0; i--) {
if (grade[i] >= 0 && grade[i] <= 100) {
count++;
System.out.println(grade[i]);
}
if (count >= 3) {
break;
}
}
}
}
if (grade[i] >= 0 && grade[i] <= 100) {
count++;
System.out.println(grade[i]);
}
if (count >= 3) {
break;
}
}
}
}
public void print(int[] grade) {
int count = 0;
Arrays.sort(grade);
System.out.println("考试成绩的前三名:");
int count = 0;
Arrays.sort(grade);
System.out.println("考试成绩的前三名:");
String[] subjects = new String[5];
System.out.println("数组中第4个科目为:" + subjects[3]);
System.out.println("数组中第4个科目为:" + subjects[3]);
2015-03-05
public class HelloWorld{
public static void main(String[] args) {
int a=12;
int b=24;
int sum=a+b;
System.out.println("两数之和为:"+sum);
}
}
public static void main(String[] args) {
int a=12;
int b=24;
int sum=a+b;
System.out.println("两数之和为:"+sum);
}
}
2015-03-04
public class HelloWorld{
public static void main(String[] args) {
String city;
city="湖南";
String name ="衡阳";
city = name ;
System.out.println("我的家乡在:"+city);
}
}
public static void main(String[] args) {
String city;
city="湖南";
String name ="衡阳";
city = name ;
System.out.println("我的家乡在:"+city);
}
}
2015-03-04
public class HelloWorld{
public static void main(String[] args) {
String city="湖南";
System.out.println("我的家乡在:"+city);
}
}
public static void main(String[] args) {
String city="湖南";
System.out.println("我的家乡在:"+city);
}
}
2015-03-04