0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 16:28:48 +00:00
OI-codes/Luogu/problem/P2708/P2708.cpp
2021-01-02 15:30:52 +08:00

20 lines
321 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int ans = s.size() - 1;
for (int i = 1; i < s.size(); i++) {
if (s[i] == s[i - 1]) {
ans--;
}
}
if (s[s.size() - 1] == '0') {
ans++;
}
cout << ans << endl;
return 0;
}