Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstdlib>
- using namespace std;
- string newString;
- string inputString;
- string removeString(string inputString)
- {
- for(int i =0; i<inputString.length();i++)
- {
- if(inputString.at(i)!= '7') {
- newString+=inputString.at(i);
- }
- }
- return newString;
- }
- int main() {
- cout << "Enter the input string: "<< endl;
- // cin >> inputString >> endl;
- getline(cin, inputString);
- cout << "The new string is: " << removeString(inputString)<< endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment