でけた。
浮動小数対応とかはご自分で

#include <stdio.h>
#include <string.h>
#include <malloc.h>

#define SEPARATORS " \t"

int innerproduct(size_t c, const int *v1, const int *v2)
{
 int i, r = 0;
 
 for (i = 0; i < c; i++)
  r += v1[i]*v2[i];
 return r;
}

void readvector(const char *s, size_t c, int *v)
{
 char *tmp = strdup(s);
 char *token = strtok(tmp, SEPARATORS);
 while (token) {
  *v++ = atoi(token);
  token = strtok(NULL, SEPARATORS);
 }
 free(tmp);
}