Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char napis[5] = "abcd";
- cout << "Ile spacji na poczatek chcesz dodac?";
- int liczba;
- cin >> liczba;
- char napis2[5 + liczba];
- int x = 0;
- for (int i = 0; i < 5 + liczba; i++) {
- if (i >= liczba) {
- napis2[i] = napis[x];
- x++;
- }
- else
- napis2[i] = ' ';
- }
- for (int i = 0; i < 5 + liczba; i++)
- cout << napis2[i];
- cout<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement