Advertisement
dimon-torchila

Untitled

Nov 20th, 2022
742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. using namespace std;
  5. string  AddString(string s) {
  6.     string s2 = "";
  7.     for(int i = 0; i < s.size(); ++i){
  8.         s2 += toupper(s[i]);
  9.         s2 += string(i,tolower(s[i]));
  10.         s2 += '-';
  11.     }
  12.     return s2;
  13. }
  14.  
  15.  
  16. int main() {
  17.     string s = "ALnske";
  18.     cout << AddString(s) << endl;
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement