string

string s;

cin>>s;

if(s.find("123")!=s.npos);

npos在 c++中表示一个常数,表示不存在的位置,类型一般是std::container_type::size_type。
其值一般为-1.

posted @ 2021-06-18 22:09  Acception  阅读(53)  评论(0)    收藏  举报