• 主页
  • Java SE
  • J2ME
  • Web开发
  • Java EE
  • Eclipse

tt

冰山英雄 2019-05-09 11:28:54
package jack.trains;


import jack.trains.bean.Town;

public class Output {

public static void main(String args[]) {

TrainService service = DistanceService.instance();


service.calcDistance(new Town('A'), new Town('B'), new Town('C')).print();


service.calcDistance(new Town('A'), new Town('D')).print();


service.calcDistance(new Town('A'), new Town('D'), new Town('C')).print();

service.calcDistance(new Town('A'), new Town('E'), new Town('B'), new Town('C')
, new Town('D')).print();

service.calcDistance(new Town('A'), new Town('E'), new Town('D')).print();
//

service = RouteService.instance();


System.out.println(service.numTrips(new Town('C'), new Town('C'), 1, 3));
System.out.println(service.numTrips(new Town('A'), new Town('C'), 4, 4));
System.out.println(service.lengthOfShortestRoute(new Town('A'), new Town('C')));
System.out.println(service.lengthOfShortestRoute(new Town('B'), new Town('B')));
System.out.println(service.numDiffRoutes(new Town('C'), new Town('C'), 30));


}

}
...全文
浏览 点赞 收藏 回复
写回复
回复

还没有回复,快来抢沙发~

发动态
发帖子
Java
创建于2007-09-28

1.8w+

社区成员

8.1w+

社区内容

Java相关技术讨论
社区公告
暂无公告