所有点都是RE
by wqc200707 @ 2022-08-24 17:28:05
你的问题是所有测试点RE对吧。
这是由于scanf()用于字符和字符串时容易出问题
将第七行
```c
scanf("%s\n",&a);
```
改成
```cpp
cin>>a;
```
这样就不会RE了~~但只能拿二十分~~
可以参考一下我的代码
```python
def finds(a_,b_):#function in PYTHON
n=0
while(len(b_)!=0):
if b_.find(a_)!=-1:
n=n+1
b_=b_[b_.find(a_)+len(a_)-1:len(b_)]
else: break#if there is no string a in b,break it
return n
a=' '+input().upper()+' '#upper is to change all the words into capital
b=' '+input().upper()+' '#of course you can use the function lower()
if b.find(a)==-1:
print(-1)
else:
print(finds(a,b),b.find(a))
```
虽说用的是Python,但是大概意思还是能让只懂C++的程序员懂得
by Godiva @ 2022-08-24 18:06:38
谢谢谢谢,前几天没看见
by wqc200707 @ 2022-08-27 17:53:58