Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <iostream>
- using namespace std;
- int main()
- {
- char s[101], x[101];
- cin.getline(s,100);
- int k=0;
- if (s[0]>='A'&&s[0]<='Z')
- {
- x[k]=s[0];
- k++;
- }
- for (int i=1; i<strlen(s); i++)
- {
- if (s[i-1]==' '&&(s[i]>='A'&&s[i]<='Z'))
- {
- x[k]=s[i];
- k++;
- }
- }
- x[k]=NULL;
- cout<<x;
- }
Advertisement
Add Comment
Please, Sign In to add comment