#include <stdio.h>

char TypeFormat[]="%d";
typedef int Type;

typedef Type V3D[3];

void SumV3D(V3D U, V3D V, V3D W);
void PrintV3D(V3D U,char C[]);
Type ProdScaV3D(V3D U, V3D V);

int main(){ 
  V3D u={1,2,3},v={1,1,1},w;
  SumV3D(u,v,w);
  PrintV3D(u,"u");
  PrintV3D(v,"v");
  PrintV3D(w,"w");
  printf("<u,v>=");
  printf(TypeFormat,ProdScaV3D(u,v));
  printf("\n");
  return 1;
}

void SumV3D(V3D U, V3D V, V3D W){
  W[0]=U[0]+V[0];W[1]=U[1]+V[1];W[2]=U[2]+V[2]; 
}
void PrintV3D(V3D U,char C[]){
  printf("%s=[",C);
  printf(TypeFormat,U[0]);
  printf(", ");
  printf(TypeFormat,U[1]);
  printf(", ");
  printf(TypeFormat,U[2]);
  printf("]\n");
}

Type ProdScaV3D(V3D U, V3D V){
   Type S=0;
   int i;
   for (i=0;i<3;i++) S+=U[i]*V[i];
   return S;
}