* #include iostream #include string using namespace std; string getSubStr(const string str,size_t iPos) { string strSubStr; if(str.size()iPos) { throw logic_error(iPos is too large); } strSubStr=str.substr(iPos); return strSubStr; } int main() { string s1(hello); coutgetSubStr(s1,3); return 0; } * #include iostream #include iomanip using namespace std; static int count=0;//全局变量 int main() { for( int i=0; i9; i++) { // do something } // some code for( int i=0; i9; i++) { // do another thing } return 0; * #include iostream using namespace std; int put(int
原创力文档

文档评论(0)