C++函数小集

文件输入输出:

......
freopen ("题目名","r",stdin);
freopen ("题目名","w",stdout);
(程序体)
//fclose(stdin);
//fclose(stdout);
......

字符串:

(1) s.insert(pos,s2) 在s下标为pos的元素前插入string类型s2
(2) s.substr(pos,len) 返回一个string类型,它包含s中下标为pos起的len个字符
(3) s.erase(pos,len) 删除s中下标为pos开始的len个字符
(4) s.replace(pos,len,s2) 删除s中下标为pos的len个字符,并在下标为pos处插入s2
(5) s.find(s2,pos)在s中以pos位置起查找s2第一次出现的位置,若查找不到返回string::nops

猜你喜欢

转载自blog.csdn.net/c_uizrp_dzjopkl/article/details/81708718