Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一项任务以这种形式获取用户输入:
"SEND name1 name2"
目标是找到名称之间的最短路径,但这目前不是问题。我不知道如何从单个输入中读取多个字符串。
第一个字符串是 SEND,但这是最简单的。我如何阅读其他两个?获得名称后,我会将它们传递给函数以找出它们之间的距离。