Find Name
Submit solution
Points:
40 (partial)
Time limit:
1.0s
Memory limit:
256M
Authors:
Problem type
Allowed languages
Java 19, Java 8
題目說明
設計一程式,讓使用者輸入一串名字清單(中間以空格分開),並存放於ArrayList中,直到輸入.
結束。
再輸入一個名字,找出他在ArrayList的index值,印出結果。
輸入
名字清單(中間以空格分開,輸入.
結束)
要查詢的名字
輸出
若找得到,輸出名字 is in the list at index 位置
若找不到,輸出名字 is not in the list.
測試資料0 輸入
John Mike Sarah Tom David .
Tom
測試資料0 輸出
Tom is in the list at index 3
測試資料1 輸入
John Mike Sarah Tom David .
James
測試資料1 輸出
James is not in the list.
Comments
題解