Guest User

Untitled

a guest
May 17th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. public static void main(String[] args) {
  2. task_A();
  3. }
  4.  
  5. public static void task_A(){
  6. Scanner in = new Scanner (System.in);
  7.  
  8. while(in.hasNext()){
  9. GraphModel gm = new GraphModel();
  10. int limit = in.nextInt();
  11. int limit2 = in.nextInt();
  12. in.nextLine();
  13.  
  14. for(int i = 0; i < limit; i++){
  15. in.next();
  16. String firstOne = String.format("%s %s %s %s", in.next(),in.next(),in.next(),in.next());
  17. String secondOne = String.format("%s %s %s %s",in.next(),in.next(),in.next(),in.next());
  18. IGpsCoordinate a = new GpsCoordinate(firstOne);
  19. IGpsCoordinate b = new GpsCoordinate(secondOne);
  20.  
  21. gm.addNode(new Node(a, b));
  22. }
  23.  
  24. for(int j=0; j<limit2; j++){
  25. int con = in.nextInt();
  26. int conTo = in.nextInt();
  27.  
  28. gm.addConnection(new Connection (gm.nodes.get(con), gm.nodes.get(conTo)));
  29. }
  30.  
  31. gm.setLimits();
  32.  
  33. System.out.printf("(%s, %s)\n(%s, %s)\n", gm.getTopLeft().getLatitude().toString(), gm.getTopLeft().getLongitude().toString(), gm.getBottomRight().getLatitude().toString(), gm.getBottomRight().getLongitude().toString());
  34. }
  35. }
Add Comment
Please, Sign In to add comment