Advertisement
mostlabs

12/3

Apr 13th, 2020
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include<cstring>
  3. #include <string.h>
  4.  
  5.  
  6. using namespace std;
  7. void secenek(char* str, const char c) {
  8.    
  9.  
  10.     int i, j;
  11.     int len = strlen(str);
  12.  
  13.     for (i = 0; i < len; i++)
  14.     {
  15.      
  16.         if (str[i] == c)
  17.         {
  18.             for (j = 0; j < len; j++)
  19.             {
  20.                 str[j] = str[i + 1];
  21.                 i++;
  22.                     len-j;
  23.              
  24.             }
  25.            
  26.             break;
  27.         }
  28.        
  29.     }
  30.    
  31. }
  32.  
  33.  
  34. int main()
  35. {
  36.  
  37.  
  38.     char str1[250];
  39.  
  40.     cin.getline(str1, 250);
  41.    
  42.     char target;
  43.     cin >> target;
  44.    
  45.  
  46.     secenek(str1, target);
  47.  
  48.     cout << str1;
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement