Advertisement
a53

Alphanum

a53
Dec 5th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. void Alphanum(char s[],char cuv[][21],int &n,int num[],int &m)
  2. {
  3. int i=0,k=0;
  4. n=0,m=0,num[0]=0;
  5. while(s[i]!='\0')
  6. {
  7. if(s[i]!=' ')
  8. {
  9. if(s[i]>='0'&&s[i]<='9')
  10. num[m]=num[m]*10+s[i]-'0';
  11. else
  12. cuv[n][k++]=s[i];
  13. }
  14. else
  15. {
  16. if(s[i-1]>='0'&&s[i-1]<='9')
  17. ++m,num[m]=0;
  18. else
  19. cuv[n][k]='\0',++n,k=0;
  20. }
  21. ++i;
  22. }
  23. if(s[i-1]>='0'&&s[i-1]<='9')
  24. ++m;
  25. else
  26. ++n,cuv[n][k]='\0';
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement