My CSSE2310 ass1.c solution