Advertisement
SteelK

Untitled

Mar 10th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     setlocale(0, "");
  9.    
  10.     char *str = new char[101];
  11.     char *strcopy = new char [101];
  12.    
  13.     cout << "Ââåäèòå ñòîêó\n";
  14.     gets(str);
  15.    
  16.     for (int i = 0; i < strlen(str); i++)
  17.     {
  18.         if ((str[i] == ',') && (str[i + 1] != ' '))
  19.         {
  20.             //str.replace(i, 1 , ", ");
  21.             strcat(str, " ");
  22.         }
  23.     }
  24.    
  25.     cout << str << endl;
  26.    
  27.     delete [] str;
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement