I'm gonna take it nice and slow now.
I started by writing something that creates pairs of triplets.
How does this look, any comments?
Code:
/*
* File: main.c
* Author: Me
*
* Created on 24 May 2010, 13:57
*/
#include <stdio.h>
#include <stdlib.h>
void main() {
int datalist[][3] = {
{0,1,2},
{3,4,5},
{2,1,5},
{2,7,2},
{4,5,9}
};
int size = sizeof(datalist)/sizeof(*datalist);
int i,j;
for(i=0;i < size;i++)
{
for(j=0;j<size;j++)
{
if(i != j)
{
printf("trips %d,%d: (%d,%d,%d),(%d,%d,%d)\n",
i,j,
datalist[i][0],datalist[i][1],datalist[i][2],
datalist[j][0],datalist[j][1],datalist[j][2] );
};
}
printf(" \n");
}
}
Next, I will try to read in data from a file.
Edit: I think that works by just adding #include "primlist.txt" in the datalist array