Problem5359--String基本练习:查找(三)

5359: String基本练习:查找(三)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

STL string基本练习题。
按照要求在字符串 S1 中反向寻找所有字符 ch 的位置。输出 ch 对应的位置,位置之间用空格隔开。否者输出 -1 。

Input

两行。
第一行一个字符串 S1 。
第二行一个字符 ch 。

Output

一行若干个整数。每个整数表示字符 ch 在字符串 S1 中出现的位置。如果没有,输出 -1。

Sample 1 Input

Hello, World!
l

Sample 1 Output

10 3 2

Sample 2 Input

Hello, World!
h

Sample 2 Output

-1

Sample 3 Input

aaa
a

Sample 3 Output

2 1 0

Source/Category