added the c code of the 1D ising model