finished triangle.c