Advertisement
Guest User

Untitled

a guest
May 24th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. /* поносная функция :( */
  2. void kostyaFunc(string input) {
  3. int counter = 0, abc;
  4. string counterS, text = input;
  5. for (int i = 0; i < input.length(); i++)
  6. {
  7.  
  8. if (input.at(i) == '.') {
  9. abc = i + 1;
  10. counterS = to_string(counter);
  11. text.insert(abc, ")");
  12. text.insert(abc, counterS);
  13. text.insert(abc, "(");
  14. counter = 0;
  15. abc = i += 3;
  16. }else
  17. counter++;
  18. }
  19. cout << text << endl;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement