Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <algorithm>
- using namespace std;
- int main() {
- string s(1, '1');
- string s1(80, '0');
- s.append(s1);
- while (s.find("10") != string::npos || s.find("1") != string::npos) {
- if (s.find("10") != string::npos) {
- s.replace(s.find("10"), 2, "001");
- }
- else if (s.find("1") != string::npos)
- {
- s.replace(s.find("1"), 1, "000");
- }
- }
- cout << count(begin(s), end(s), '0');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement