Advertisement
sellmmaahh

popravni-sept-2014-zad4

Jul 30th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. void IzmijeniString (string &s)
  8. {
  9.     auto a(s.begin());
  10.     while (a!=s.end())
  11.     {
  12.         if ((*a>='a' && *a<='z') &&( *(a-1)==' ' ||(*(a-1)>='0' && *(a-1)<='9'))) *a=(*a)-32;
  13.         a++;
  14.     }
  15. }
  16.  
  17. int main () {
  18.     string rec={"Dobio sam 25maraka."};
  19.     IzmijeniString(rec);
  20. cout<<rec;
  21. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement