Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- change(char *be, char *ki, int n)
- {
- int sz = 0;
- int k = 0;
- for (int i = 0; be[i] != '\n'; i++)
- {
- if (sz % n == 0)
- {
- ki[k] = be[i];
- k++;
- }
- if (be[i] == ' ')
- {
- sz++;
- }
- }
- ki[k-1] = '\0';
- }
- int main()
- {
- char ch[50];
- char chki[50];
- fgets(ch, 50, stdin);
- change(ch, chki, 3);
- printf("%s", chki);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement