helsinki2103

UIT 8.02

Dec 29th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. void myStrcpy(char s[], int vt, char s1[], int k)
  2. {
  3.     for (int i=0; i<MAX; i++) s[i] = s1[i];
  4. }
  5.  
  6. void Chuanhoa(char s[])
  7. {
  8.     char cur[MAX];
  9.     int i = 0, j = 0;
  10.     int f = 1;
  11.     bool first = 1;
  12.     while (i<MAX)
  13.     {
  14.         if (s[i]=='.')
  15.         {
  16.             while (j>0 && cur[j - 1]==' ') j--;
  17.             cur[j] = s[i];
  18.             ++j;
  19.             cur[j] = ' ';
  20.             ++j;
  21.             ++i;
  22.             while (s[i]==' ') ++i;
  23.         }
  24.         else
  25.         {
  26.             cur[j] = s[i];
  27.             ++j;
  28.             ++i;
  29.         }
  30.     }
  31.     for (int i=0; i<MAX; i++) s[i] = cur[i];
  32. }
Advertisement
Add Comment
Please, Sign In to add comment