5358: String基本练习:查找(二)
[Creator : ]
Description
STL string基本练习题。
按照要求在字符串 S1 中寻找所有字符 ch 的位置。输出 ch 对应的位置,位置之间用空格隔开。否者输出 -1 。
按照要求在字符串 S1 中寻找所有字符 ch 的位置。输出 ch 对应的位置,位置之间用空格隔开。否者输出 -1 。
Input
两行。
第一行一个字符串 S1 。
第二行一个字符 ch 。
第一行一个字符串 S1 。
第二行一个字符 ch 。
Output
一行若干个整数。每个整数表示字符 ch 在字符串 S1 中出现的位置。如果没有,输出 -1。
Sample 1 Input
Hello, World!
l
Sample 1 Output
2 3 10
Sample 2 Input
abc d
e
Sample 2 Output
-1