Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- string n;
- cin >> n;
- for(int i = 0; i < n.size(); i++) {
- char c = n[i];
- int brojac = 0;
- while(i < n.size() and c == n[i]) {
- i++;
- brojac++;
- }
- i -= 1;
- cout << brojac << c;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement