Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- string data;
- cin>>data;
- string ans="";
- int counter=0;
- for(int i=0; i<data.size(); i++)
- {
- if(data[i]=='1')
- {
- counter++;
- ans+=data[i];
- if(counter==5)
- {
- ans+='0';
- counter=0;
- }
- }
- else
- ans+=data[i],counter=0;
- }
- cout<<ans<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement