Advertisement
Guest User

program cpp

a guest
Sep 14th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. #include <conio.h>
  5.  
  6. using namespace std;
  7.  
  8. string podaj(string glowny, string dodaj, int ile)
  9. {
  10. for (int indeks = 0; indeks < ile; indeks++)
  11. {
  12. cout << "Podaj wyraz " << indeks + 1 << " \n";
  13. cin >> dodaj;
  14. glowny += dodaj;
  15. glowny += ", ";
  16. dodaj = "";
  17. }
  18. return glowny.c_str();
  19. }
  20.  
  21.  
  22. int main()
  23. {
  24. string lancuch_glowny, lancuch_poboczny;
  25. int liczba_wyrazow = 10;
  26. podaj(lancuch_glowny, lancuch_poboczny, liczba_wyrazow);
  27. cout << "Ciag znakow to: " << lancuch_glowny.c_str() << endl;
  28. system( "PAUSE" );
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement