Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1.  
  2. // Created by Damian Konopka ELO
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <string>
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12. string tekst;
  13. cin >> tekst;
  14. int dlugosc = tekst.length();
  15. int pozycja = -1;
  16. pozycja = tekst.find('.');
  17. if(pozycja>=0)
  18. tekst.replace(pozycja, 1, ",");
  19. else
  20. {
  21. pozycja = tekst.find(',');
  22. if (pozycja >= 0)
  23. {
  24. tekst.erase(dlugosc-2, 2);
  25. tekst.erase(0, 2);
  26. }
  27. }
  28. cout << tekst << endl;
  29. system("pause");
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement