Advertisement
didiwot

6.6var

Dec 15th, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdio>
  4. #include <cstring>
  5. using namespace std;
  6. int main  ()
  7. {
  8. char stroka[100];
  9. puts("BBEDITE STROKU!");
  10. cin >> (stroka); //gets (stroka);
  11. int dlina=strlen(stroka);
  12. char *ptr=0;
  13. int i=0;
  14.  
  15. do
  16. {
  17.     if(stroka[i]>='0' && stroka[i]<='9')
  18.         {if(!ptr){ptr=&stroka[i];}}
  19.     else
  20.         if(ptr) {stroka[i]='\0';cout<<ptr<<endl;ptr=0;}
  21.     i++;
  22. }while(stroka[i]!='\0');
  23. if(ptr) cout<<ptr<<endl;
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement