A = Accusative - with -n ending
G = Genitive - without -n ending
Mi havas [cent](numeral; not a noun) [pomojn](noun,A).
Mi havas [centon](nound,A) [da pomoj](noun,G).
So, the first "cent" is a numeral. It is not a noun and that's why there is no -n ending, even though it's technically an accusative, but except miliono, miliardo, etc. (which are nouns), there are no -n endings because there are no nouns.
The second sentence cento is a noun in accusative, so standard rules apply.
Check "Substantival (noun type) number words" section here: https://lernu.net/en/gramatiko/nombraj_vortoj