Assuming that what A said is true, then A is not a criminal. What b said is false. He said that Ding was a criminal, then Ding was not a criminal, and what Ding said should be false. Ding said that he is not a criminal, so he is a criminal, which is contradictory and the assumption is untenable.
Suppose what B said is true, then Ding is a criminal, and what A said should be false. He said that I am not a criminal, so A is a criminal, which is contradictory and the assumption is untenable.
Assuming that what C said is true, then B is a criminal, and what A said should be false. He said that I am not a criminal, so A is a criminal, which is contradictory and the assumption is untenable.
Assuming that what Ding said is true, then Ding is not a criminal, and what the other three people said is false. If A says that he is not a criminal, then A is a criminal, which is consistent. If B says that Ding is a criminal and Ding is not a criminal, it is consistent. If c says that b is a criminal and b is not a criminal, it is consistent.