first commit

This commit is contained in:
Nyagami
2022-12-15 23:51:04 +07:00
commit 87d51fb251
292 changed files with 12623 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
import java.io.File;
import java.io.IOException;
import java.util.*;
public class Main {
static class ob {
String code, name;
Long sl, price, ck, sum;
public ob(String code, String name, long sl, long price, long ck) {
this.code = code;
this.name = name;
this.sl = sl;
this.price = price;
this.ck = ck;
this.sum = price * sl - ck;
}
@Override
public String toString() {
return code + " " + name + " " + sl + " " + price + " " + ck + " " + sum;
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
ArrayList<ob> a = new ArrayList<>();
for (int i = 0; i < n; i++) {
sc.nextLine();
a.add(new ob(sc.nextLine(), sc.nextLine(), sc.nextLong(), sc.nextLong(), sc.nextLong()));
}
a.sort((ob x, ob y) -> y.sum.compareTo(x.sum));
a.forEach(e -> System.out.println(e));
}
}