Sorry, I posted bad code above, that was what I was playing with.
Don't forget to keep a counter for everytime you print. That will keep count for you.
int num, count, t1, t2, t3;
printf("Enter a number: ");
count = 0;
for (t1 = 0; t1 <= num; t1++)
for (t2 = 0; t2 <= num; t2++)
/* This can replace the for loop.
t3 = num - t1 - t2;
if (t3 >= 0)
printf("%d %d %d\n", t1, t2, num - t1 - t2);
for(t3 = num - t1 - t2; (t3 >= 0); t3--)
printf("%d %d %d\n", t1, t2, t3);
printf ("Count = %d\n", count);