Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Noote implements Comparable {
- int a;
- int b;
- Noote(int a, int b) {
- this.a = a;
- this.b = b;
- }
- @Override
- public int compareTo(Object o) {
- {
- Noote tmp = (Noote) o;
- if (this.a > tmp.a) {
- return 1;
- }
- if (this.a < tmp.a) {
- return -1;
- }
- }
- return 0;
- }
- }
- --------------------------------------------------------------
- int n = readInt();
- Noote[] NooteBooks = new Noote[n];
- for (int i =0;i<0;i++){
- int a =readInt();
- int b =readInt();
- NooteBooks[i]=new Noote(a,b);
- }
- out.println(NooteBooks[1]);
- Arrays.sort(NooteBooks);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement