Files
Story-With-Thanh/J07073 - ĐĂNG KÝ HÌNH THỨC GIẢNG DẠY.java
T
2022-12-15 23:51:04 +07:00

47 lines
1.2 KiB
Java

import java.util.*;
import java.io.*;
/**
*
* @author GIGABYTE
*/
public class Main {
static class ob{
String code, name, i, lt, th;
public ob(String a, String b, String c, String d, String e){
code = a;
name = b;
i = c;
lt = d;
th = e;
};
public boolean oke(){
if(th.compareTo("Truc tuyen") == 0) return true;
if(th.endsWith(".ptit.edu.vn")) return true;
return false;
}
@Override
public String toString(){
return code + ' ' + name + ' ' + i + ' ' + lt + ' ' + th;
}
}
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new File("MONHOC.in"));
// Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
ArrayList<ob> a = new ArrayList<>();
sc.nextLine();
while(n-->0) a.add(new ob(sc.nextLine(),sc.nextLine(),sc.nextLine(),sc.nextLine(),sc.nextLine()));
a.sort((ob x, ob y) -> {
return x.code.compareTo(y.code);
});
a.forEach(e ->{
if(e.oke()) System.out.println(e);
});
}
}