fork(1) download
  1. #include <iostream>
  2. #include <cstring>
  3. #include<algorithm>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string napis;
  9. string szukaj=" ";
  10. size_t pozycja=-1;
  11. while(getline(cin,napis))
  12. {
  13. for(int i=0;napis[i]!='\0';i++)
  14. {
  15. if((i==0)||(napis[i-1]== ' '))
  16. napis[i]=toupper(napis[i]);
  17. else
  18. napis[i]=tolower(napis[i]);
  19. }
  20. pozycja=napis.find(szukaj);
  21. while(pozycja!=string::npos)
  22. {
  23. napis.erase(pozycja,1);
  24. pozycja=napis.find(szukaj);
  25. }
  26. cout<<napis;
  27. }
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 3464KB
stdin
Dzis jest sobota,
stdout
DzisJestSobota,