The invention discloses pyrimidotricyclic compounds or pyrimidotetracyclic compounds having a structure represented by the formula (I), (II) or (III), pharmaceutically-acceptable salts, stereoisomers, or prodrug molecules. The compounds can inhibit various tumor cells, and especially, the compounds can selectively act on lung cancer cells of EGFR L858R / T790 and EGFR E745 A750 / T790M. Compared to wild type cancer cells, the IC50 of the compounds is 10 times, 100 times or even 1000 times higher. The compounds are a novel protein kinase inhibitor, which can overcome the drug resistance of EGFR-TKI and has selectivity.