Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String []args){
- System.out.println("Nhập số sinh viên: ");
- int n = sc.nextInt();
- String hoten[] = new String[n];
- double diem[] = new double[n];
- int a[] = new int[n];
- for(int i = 0; i < n; i++){
- sc.nextLine();
- System.out.println("Nhập tên: ");
- hoten[i] = sc.nextLine();
- System.out.println("Nhập điểm: ");
- diem[i] = sc.nextInt();
- }
- for(int i = 0; i < n; i++){
- System.out.println("Họ và tên: " + hoten[i]);
- Arrays.sort(diem);
- System.out.println("Điểm: " + diem[i]);
- if(diem[i] < 5){
- System.out.println("Yếu");
- }
- else if(diem[i] < 6.5){
- System.out.println("Trung bình");
- }
- else if(diem[i] < 7.5){
- System.out.println("Khá");
- }
- else if(diem[i] < 9){
- System.out.println("Giỏi");
- }
- else{
- System.out.println("Xuất sắc");
- }
- }
- for(int i = 0; i < n; i++){
- for(int j = 0; j < n; j++){
- if(diem[i] > diem[j]){
- int temp = a[i];
- a[i] = a[j];
- a[j] = temp;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement