This question already has an answer here:
I will argue by induction that a $p$-group $P$ with exactly one subgroup of each order $d\mid |P|$ is cyclic.
If the order is $1$ or $p$ (or even $p^2$), it is obvious.
So assume we did all cases of smaller order and consider the center $Z = \mathbf Z(P)$. Note that $Z>1$ because $P$ is a $p$-group. If $Z=P$ then we may use the structure theorem for finite abelian groups and we are done. Otherwise, assume $Z<P$, then $P/Z$ has at most one subgroup of order $d$ for each $d\mid |P/Z|$ by the correspondence theorem, on the other hand it is a $p$-group and therefore has at least one subgroup of order $d$ for each $d\mid |P/Z|$. It follows that $P/Z$ has exactly one subgroup for each divisor and thus must by cyclic because of our inductive hypothesis. Then $P$ is abelian which contradicts $Z<P$.
Here is a different proof, very similar to the arguments used here..
Again, we argue by induction and observe that it is trivial for small $p$-groups. Consider the unique subgroup $H$ of order $|P|/p$. Surely this subgroup is a $p$-group and therefore must have at least (and hence precisely) one subgroup for each divisor or $|H|$.
Now take an arbitrary element $x\in P\setminus H$. Then $\langle x\rangle$ is a subgroup of some order that is not yet contained in $H$. The only option is then that the order is $|P|$ and thus $P$ is cyclic with $x$ as its generator.