fork(1) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. void Spacer(string s){
  8.  
  9. for(int i=0;i<s.length();i++){
  10. if(s[i]==' '){
  11. s[i+1]-=32; //zamien na duza
  12. s.erase(i,1); // usun spacje
  13. }
  14.  
  15.  
  16. }
  17. cout<<s<<endl;
  18. }
  19.  
  20. int main(){
  21.  
  22. string s1="";
  23. getline(cin,s1);
  24. Spacer(s1);
  25. getline(cin,s1);
  26. Spacer(s1);
  27.  
  28.  
  29.  
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0s 15232KB
stdin
Dzisiaj jest czwartek,
A jutro bedzie piatek.
stdout
DzisiajJestCzwartek,
AJutroBedziePiatek.