Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits\stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- string s;
- cin >> s;
- int c = 0, i;
- for(i = 0; i < n; i += 2)
- {
- if(s[i] == s[i+1]) c++;
- }
- printf("%d\n", c);
- for(i = 0; i < n; i += 2)
- {
- if(s[i] == s[i+1])
- {
- s[i] = 'a';
- s[i+1] = 'b';
- }
- }
- cout << s << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement