count the amount of words in string
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>


int count_words(char *sentence) {
    int count = 0;

    char* token = strtok(sentence, " ");
    while (token) {
        token++;
        token = strtok(NULL, " ");
    }

    return count;
}

int main() {
    int n;
    n = count_words("gcc -Wall -g -std=gnu99 -o main linked_list.o main.o");
    printf("%d\n", n);

    return 0;
}

