第三题输入为:
Picture Perfect (1997)/Aniston, Jennifer/Bacon, Kevin/Dukakis, Olympia/Mohr, Jay
Planes, Trains & Automobiles (1987)/Bacon, Kevin/Candy, John/Martin, Steve/Robins, Laila
代码给的输出结果是:
Enter actor name (or 'E' to exit):
Picture Perfect (1997)/Aniston, Jennifer/Bacon, Kevin/Dukakis,
Olympia/Mohr, Jay
Planes, Trains & Automobiles (1987)/Bacon, Kevin/Candy, John/Martin,
Steve/Robins, Laila
Picture Perfect (1997)/Aniston, Jennifer/Bacon, Kevin/Dukakis, is not connected to Kevin Bacon.
Enter actor name (or 'E' to exit):
Olympia/Mohr, Jay is not connected to Kevin Bacon.
Enter actor name (or 'E' to exit):
Planes, Trains & Automobiles (1987)/Bacon, Kevin/Candy, John/Martin, is not connected to Kevin Bacon.
Enter actor name (or 'E' to exit):
Steve/Robins, Laila is not connected to Kevin Bacon.
Enter actor name (or 'E' to exit):
但是实际上正确的输出应该长这样: