SHARE
TWEET

Untitled

a guest Aug 13th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. string s, t;
  6. int k;
  7.  
  8. int main()
  9. {
  10.     while(getline(cin, s))
  11.     {
  12.         string t;
  13.         for(int i=0; i<=s.length(); i++)
  14.         {
  15.  
  16.             if(s[i]==' ')
  17.             {
  18.                 while(s[i]==s[i+1])
  19.                 {
  20.                     i++;
  21.                 }
  22.                 s[i+1] = toupper(s[i+1]);
  23.                 t+=s[i+1];
  24.                 i++;
  25.             }
  26.             else t+=s[i];
  27.         }
  28.         t[0]=toupper(t[0]);
  29.         cout<< t<< endl;
  30.     }
  31.  
  32.     return 0;
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top