Advertisement
Josif_tepe

Untitled

Jan 27th, 2025
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <ctype.h>
  4. using namespace std;
  5.  
  6. int main() {
  7.     char s[1000];
  8.     cin >> s;
  9.    
  10.     char c;
  11.     cin >> c;
  12.    
  13.     char s2[1000];
  14.     int idx = 0;
  15.    
  16.     for(int i = 0; i < strlen(s); i++) {
  17.         if(s[i] != c) {
  18.             s2[idx] = s[i];
  19.             idx++;
  20.         }
  21.     }
  22.     cout << s2 << endl;
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement