@[sqrt404](/user/637410) 用 `num.begin() + int`
by XuYueming @ 2024-02-22 16:03:35
@[sqrt404](/user/637410)
`num.erase(num[i]);`
by wangif424 @ 2024-02-22 16:04:41
@[XuYueming](/user/728079) 能否给下具体代码,vector的成员函数大多不太熟悉
by sqrt404 @ 2024-02-22 16:06:59
`num.erase(num.begin() + i);`
by XuYueming @ 2024-02-22 16:10:58
@[sqrt404](/user/637410)
by XuYueming @ 2024-02-22 16:11:08
@[XuYueming](/user/728079) 感谢
by sqrt404 @ 2024-02-22 16:12:13
此贴结
by sqrt404 @ 2024-02-22 16:12:34
@[sqrt404](/user/637410) 注意这里 `i` 从 $0$ 开始,而不是你代码里的 $1$,或者用 `num.begin() + i - 1` 也行。
by XuYueming @ 2024-02-22 16:13:32