Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int* dlugosci_slow(int szerokosc, char* tab)
- {
- int ilosc_slow = 0;
- int i = 0;
- int max = 0;
- while (tab[i] != NULL)
- {
- if (tab[i] == ' ')
- ilosc_slow++;
- i++;
- }
- ilosc_slow++;
- int* tab_pom = (int*)malloc(ilosc_slow * sizeof(int));
- i = 0;
- int j = 0;
- while (tab[i] != NULL)
- {
- if (tab[i] != ' ')
- max++;
- else
- {
- tab_pom[j] = max;
- j++;
- max = 0;
- }
- i++;
- }
- return tab_pom;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement