Advertisement
qwerty4657

cpp

Oct 13th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. char v[51],l[51]={" "},c[51]={" "};
  8. int nr=0,lit=0;
  9. cin.get(v,51);
  10.  
  11. for(int i=0;i<strlen(v);i++)
  12. {
  13. if( (v[i]>= '0') && (v[i] <='9') )
  14. {
  15. c[nr]=v[i];
  16. nr++;
  17.  
  18. }
  19. else if( ((v[i]>='A') && (v[i]<='Z')) or ((v[i]>='a') && (v[i]<='z')) )
  20. {
  21. l[lit]=v[i];
  22. lit++;
  23. }
  24. }
  25. cout<<c;
  26. cout<<endl;
  27. cout<<l;
  28. cout<<endl;
  29. cout<<nr<<" "<<lit;
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement