Advertisement
STANAANDREY

bacT14 sIII 2

May 24th, 2021
851
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4. #define NMAX 103
  5. char s[NMAX];
  6.  
  7. int main() {
  8.     cin.getline(s, NMAX);
  9.     int n = strlen(s);
  10.     for (int i = 0; i < n; i++) {
  11.         if (s[i] == '-') {
  12.             strcpy(s + i, s + i + 1);
  13.         }
  14.     }
  15.     cout << s << endl;
  16.     return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement