Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char v[51],l[51]={" "},c[51]={" "};
- int nr=0,lit=0;
- cin.get(v,51);
- for(int i=0;i<strlen(v);i++)
- {
- if( (v[i]>= '0') && (v[i] <='9') )
- {
- c[nr]=v[i];
- nr++;
- }
- else if( ((v[i]>='A') && (v[i]<='Z')) or ((v[i]>='a') && (v[i]<='z')) )
- {
- l[lit]=v[i];
- lit++;
- }
- }
- cout<<c;
- cout<<endl;
- cout<<l;
- cout<<endl;
- cout<<nr<<" "<<lit;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement