Advertisement
DaniDori

ЗАДАЧА №950 Сжатие бинарных последовательностей

Apr 13th, 2023
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a = 0;
  8. string s ;
  9. cin >> s;
  10. for (int i = 0; i < s.size(); i++) {
  11. if (s[i] == '0')
  12. a++;
  13. else {
  14. cout << char('a' + a);
  15. a = 0;
  16. }
  17. }
  18. //cout << char('a' + 25);
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement