Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstdlib>
- #include <conio.h>
- using namespace std;
- string podaj(string glowny, string dodaj, int ile)
- {
- for (int indeks = 0; indeks < ile; indeks++)
- {
- cout << "Podaj wyraz " << indeks + 1 << " \n";
- cin >> dodaj;
- glowny += dodaj;
- glowny += ", ";
- dodaj = "";
- }
- return glowny.c_str();
- }
- int main()
- {
- string lancuch_glowny, lancuch_poboczny;
- int liczba_wyrazow = 10;
- podaj(lancuch_glowny, lancuch_poboczny, liczba_wyrazow);
- cout << "Ciag znakow to: " << lancuch_glowny.c_str() << endl;
- system( "PAUSE" );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement