Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#6
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char str[50];
- char cifra;
- cin.getline(str, 50);
- cin >> cifra;
- int n = strlen(str);
- for(int i = 0; i < n; i++){
- if(str[i] == cifra){
- for(int j = i + 1; j < n; j++){
- str[j - 1] = str[j];
- }
- i--;
- n--;
- }
- }
- for(int i = 0; i < n; i++){
- cout << str[i];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment