Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void wstaw(char * cel, const char * zrodlo, char symbol) {
- unsigned int zrodlo_n = strlen(zrodlo);
- unsigned int offset = 0;
- unsigned int size = zrodlo_n + ceil(zrodlo_n / 3) + 1;
- for (unsigned int i = 0; i < zrodlo_n; i++) {
- cel[i+offset] = zrodlo[i];
- if ((i+1) % 3 == 0) {
- offset++;
- cel[i+offset] = symbol;
- }
- }
- cel[size-1] = '\0';
- for(int k=0;k<size;k++){
- cout<<cel[k]<<endl;}
- }
- int main()
- {
- char t[]="Ala ma Kota";
- char z[20];
- wstaw(z,t,'x');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement