Advertisement
dllbridge

Untitled

Apr 10th, 2025
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.56 KB | None | 0 0
  1.  
  2. #include  <iostream>
  3. #include   <iomanip>
  4. #include   <cstring>
  5. using namespace std;
  6.  
  7.  
  8.  
  9.  
  10. string s1     = "Laptev Matveevich";
  11. string s2     =            "Mihail";
  12.  
  13.  
  14.  
  15.  
  16.  
  17. ///////////////////////////////////////////////////////////
  18. int main()
  19. {
  20.    
  21.     int n = s1.find(" ");
  22.  
  23.     s1.insert(  n," ");
  24.     s1.insert(n+1, s2);
  25.  
  26.     cout << "s1 = " << s1 << endl;
  27.  
  28. }
  29.  
  30. */
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. /*
  47. #include  <iostream>
  48. #include   <iomanip>
  49. #include   <cstring>
  50. using namespace std;
  51.  
  52.  
  53.  
  54.  
  55. string s1     = "Hello, World!";
  56.  
  57. char sz2[88]  =   "SONY ";
  58.  
  59.  
  60.  
  61.  
  62.  
  63. ///////////////////////////////////////////////////////////
  64. int main()
  65. {
  66.    
  67.    
  68.   //  for(int i = 0; i < s1.size(); i++)
  69.     for(int i = 0; i < s1.length(); i++)
  70.     {
  71.          cout << "s1[" << setw(2) << i << "] = " << s1[i] << endl;
  72.     }  
  73.    
  74. return 0;
  75. }
  76.  
  77. */
  78.  
  79.  
  80.  
  81.  
  82.  
  83. /*
  84.  
  85. #include  <iostream>
  86. #include   <cstring>
  87. using namespace std;
  88.  
  89.  
  90.  
  91.  
  92. string s1     = "Hello";
  93.  
  94. char sz2[88]  =   "SONY ";
  95.  
  96.  
  97.  
  98.  
  99.  
  100. ///////////////////////////////////////////////////////////
  101. int main()
  102. {
  103.    
  104.     strcat(sz2, s1.c_str());
  105.    
  106.     cout << "sz2 = " <<  sz2 << endl;
  107.  
  108.  //   cout << "sz = " << sz2 << endl;  
  109.    
  110. return 0;
  111. }
  112.  
  113. */
  114.  
  115.  
  116.  
  117. /*
  118. #include <iostream>
  119. using namespace std;
  120.  
  121.  
  122.  
  123.  
  124. string s1     = "Hello";
  125.  
  126. char sz2[88]  =   " SONY";
  127.  
  128.  
  129.  
  130.  
  131.  
  132. ///////////////////////////////////////////////////////////
  133. int main()
  134. {
  135.    
  136.     s1 += sz2;
  137.    
  138.     cout << "s1 = " <<  s1 << endl;
  139.  
  140.     cout << "sz = " << sz2 << endl;    
  141.    
  142. return 0;
  143. }
  144.  
  145. */
  146.  
  147.  
  148.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement