fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string tekst;
  6. int b,c,d;
  7. cin>>tekst;
  8. d=tekst.length();
  9. if(tekst=="")
  10. cout<<"PUSTY";
  11. else{
  12. for(int i=0; i<d; i++){
  13. if(tekst[i]=='0'){
  14. b=i+1;
  15. break;
  16. }
  17. }
  18. for(int i=d-1; i>=0; i--){
  19. if(tekst[i]=='1'){
  20. c=i;
  21. break;
  22. }
  23. }
  24. for(int i=b; i<c; i++){
  25. cout<<tekst[i];
  26. }
  27. }
  28. }
Success #stdin #stdout 0s 5616KB
stdin
12302198102
stdout
2198