mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-09 02:18:51 +00:00
20 lines
321 B
C++
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;
|
||
|
}
|