First we can paraphrase your argument as such:
If cigarette is the cause of cancer, then non-smoker will not get cancer.
This can be called Fallacy of the single cause as reference:
The fallacy of the single cause, also known as complex cause, causal oversimplification, causal reductionism, and reduction fallacy, is an informal fallacy of questionable cause that occurs when it is assumed that there is a single, simple cause of an outcome when in reality it may have been caused by a number of only jointly sufficient causes.
It can be logically reduced to: " X caused Y; therefore, X was the only cause of Y" (although A,B,C...etc. also contributed to Y.)
Your argument can further be translated to propositional calculus as:
If cigarette is the cause of cancer (P), then one will get cancer (Q).
If one doesn't smoke cigarette (R), then one will not get cancer (~Q).
Then it will become clear that this is not a case as in any material condition as R != ~P.
Hasty generalization is usually committed in inductive reasoning process, like cherry picking, by only observing a few similar cases one would hastily generalize to a more general situation.
Hasty generalization is the fallacy of examining just one or very few examples or studying a single case, and generalizing that to be representative of the whole class of objects or phenomena.