Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cstring>
- using namespace std;
- string s1 = "Laptev Matveevich";
- string s2 = "Mihail";
- ///////////////////////////////////////////////////////////
- int main()
- {
- int n = s1.find(" ");
- s1.insert( n," ");
- s1.insert(n+1, s2);
- cout << "s1 = " << s1 << endl;
- }
- */
- /*
- #include <iostream>
- #include <iomanip>
- #include <cstring>
- using namespace std;
- string s1 = "Hello, World!";
- char sz2[88] = "SONY ";
- ///////////////////////////////////////////////////////////
- int main()
- {
- // for(int i = 0; i < s1.size(); i++)
- for(int i = 0; i < s1.length(); i++)
- {
- cout << "s1[" << setw(2) << i << "] = " << s1[i] << endl;
- }
- return 0;
- }
- */
- /*
- #include <iostream>
- #include <cstring>
- using namespace std;
- string s1 = "Hello";
- char sz2[88] = "SONY ";
- ///////////////////////////////////////////////////////////
- int main()
- {
- strcat(sz2, s1.c_str());
- cout << "sz2 = " << sz2 << endl;
- // cout << "sz = " << sz2 << endl;
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- string s1 = "Hello";
- char sz2[88] = " SONY";
- ///////////////////////////////////////////////////////////
- int main()
- {
- s1 += sz2;
- cout << "s1 = " << s1 << endl;
- cout << "sz = " << sz2 << endl;
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement