fork download
  1. #include<bits/stdc++.h>
  2. #define MOD 1000000007
  3. #define quick ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
  4. using namespace std;
  5. typedef long long ll;
  6. typedef long double ld;
  7.  
  8. int main()
  9. {
  10. ll t;
  11. cin>>t;
  12. while(t--)
  13. {
  14. string s;
  15. cin>>s;
  16. ll ans=0;
  17. for(ll i=0;i<s.length();i++)
  18. {
  19. ans++;
  20. if(s[i]=='0')
  21. break;
  22. }
  23. cout<<ans<<endl;
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0s 4320KB
stdin
3
0
100
11
stdout
1
2
2