@[liuweida0330](/user/1116551)
```cpp
if((s1<s2&&len1==len2)||len1<len2){
swap(s1,s2);
j=true;
}
```
你没有交换 `len1` 和 `len2`。
另外还有个小问题:
```cpp
while(c[m]==0)
m--;
```
如果这里结果是 $0$ 的话 $m$ 就会减到负数,最好加判 $m>0$。
by Disjoint_cat @ 2024-03-18 13:33:08
感谢感谢
by liuweida0330 @ 2024-03-18 16:08:36
@[liuweida0330](/user/1116551)
```cpp
while(c[m]==0)
m--;
```
这行如果没有判断m>0会得90分
by python18 @ 2024-04-21 09:27:55
@[python18](/user/1182672)
感谢
by liuweida0330 @ 2024-04-22 12:57:30
@[liuweida0330](/user/1116551)
没事没事
by python18 @ 2024-04-22 16:24:21