Assuming you're working flat and not in the round, yes, alternate knit rows with purl rows, even or odd number of rows doesn't matter. If your first row is a knit row, it will be 1 row knit, 1 row purl, 1 row knit; if the first is a purl row, it will be 1 row purl, 1 row knit, 1 row purl. The pattern writer will have taken this into consideration and the next row will be written appropriately.
If you're working in the round, all rows are knit for stockinette. I mention this because many hat patterns are worked in the round.
Cheating is an option. . . . Cheaters never win and winners never cheat, but smart knitters who want to retain an iota of sanity do, cheerfully. ~~Kory Stamper