Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- string zamiana(string fraza)
- {
- int dl=fraza.length(); // dlugosc wpisanej frazy
- string nowy=""; //nowy lancuch
- for (int i=0; i<dl; i++)
- {
- if (fraza[i]=='i')
- {
- nowy+='!';
- }
- else
- {
- nowy+=fraza[i];
- }
- }
- return nowy;
- }
- int main()
- {
- string fraza; //wprowadzona fraza
- string nfraza; // nowa fraza
- cout<< " podaj dowolona fraze "<<endl;
- getline (cin, fraza);
- cout<< " fraza po zamianie znakow wyglada nastepujaco "<<zamiana(fraza)<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement