Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. //
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6. int main()
  7. {
  8. int ind;
  9. string s1;
  10. getline(cin, s1);
  11. for(int i=0;i<=s1.size();i++)
  12. {
  13. if(s1[i]=='a')
  14. {
  15. s1[i]='b';
  16. ind++;
  17. }
  18. if(s1[i]=='A')
  19. {
  20. s1[i]='B';
  21. ind++;
  22. }
  23. }
  24. cout<<s1<<endl<<ind;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement