A. inc ARG( 465A A. inc ARG)


  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. int n;
  5. cin>>n;
  6. string s;
  7. cin>>s;
  8. int i=0,ans=1;
  9. s = string(s .rbegin(),s .rend());
  10. for( i=s.length()-1;i>=0;--i){
  11.  
  12. if(s[i]=='0') {
  13.  
  14. break;}else ans++;
  15. }
  16. if(ans>=n)
  17. cout<<n;
  18. else cout<<ans;
  19. return 0;
  20.  
  21. cout<<s;
  22.  
  23. }

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

Aptitude test assistant programmer 2018

1041A. Heist solution