Advertisement
Guest User

Untitled

a guest
May 21st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. void v(string s, int n = 0){
  5. if (s[n] != '\0'){
  6. if (s[n] >= 'a' && s[n] <= 'z' && !(n%2))
  7. cout <<(char) (s[n] + ('A' - 'a'));
  8. else
  9. cout << s[n];
  10. v(s, n + 1);
  11. }
  12. }
  13. int main(){
  14. string x;
  15. getline (cin, x);
  16. v(x);
  17. cout << endl;
  18. system("pause");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement