Statis

2828

Feb 12th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <string.h>
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     char s[101], x[101];
  7.     cin.getline(s,100);
  8.     int k=0;
  9.     if (s[0]>='A'&&s[0]<='Z')
  10.     {
  11.         x[k]=s[0];
  12.         k++;
  13.     }
  14.     for (int i=1; i<strlen(s); i++)
  15.     {
  16.         if (s[i-1]==' '&&(s[i]>='A'&&s[i]<='Z'))
  17.         {
  18.             x[k]=s[i];
  19.             k++;
  20.         }
  21.     }
  22.     x[k]=NULL;
  23.     cout<<x;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment