This is a problem from Stanford Algebra Qualifying Exam, Fall 1998. I know the standard way is to use Sylow theorems and semidirect product.
$171 = 9\cdot 19$.
By Sylow theorems, $n_3|19$ and $n_3\equiv 1\text{ mod }3$, hence $n_3 = 1\text{ or }19$.
$n_{19}|9$ and $n_{19}\equiv 1\text{ mod }19$, hence $n_{19} = 1$.
Denote one Sylow $3$-subgroup by $K$ and one Sylow $19$-subgroup by $N$.
$N$ is normal because $n_{19} = 1$.
$NK = G, N\cap K = \{e\}$ and $N$ is normal.
Hence, $G$ is the semiproduct of $G = N\rtimes K$.
Case 1: $G$ is abelian. Since a finite abelian group is isomorphic to direct product of cyclic groups of prime power orders, $G\cong C_9\times C_{19}$ or $C\cong C_3\times C_3\times C_{19}$.
Case 2: $G$ is not abelian. The structure of $G$ is determined by $N, K$ and homomorphism $\varphi: K\to\text{Aut}(N)$, which stands for conjugation.
What's more, $N, K, \varphi$ and $N, K,\varphi'$ define two isomorphic groups if there exists automorphism $\alpha:K\to K$ such that $\varphi' = \varphi\circ\alpha$.
Since $N\cong C_{19}$, $\text{Aut}(N)\cong C_{18}$.
Since $G$ is not abelian, the image $\varphi(K)$ is not the trivial group.
Denote the generating element in $\text{Aut}(N)\cong C_{18}$ by $z$.
When $K\cong C_9$, there are two possiblities for $\varphi(K)$: $\varphi(K) = \{1, z^6, z^{12}\}$ or $\varphi(K) = \{1, z^2, z^4,\ldots,z^{16}\}$.
When $C\cong C_3\times C_3$, $\varphi(K)$ can only be $\{1,z^6,z^{12}\}$.
What's more, given $\varphi,\varphi':K\to C_{18}$ with $\varphi(K) = \varphi'(K)$, there exists automorphism $\alpha:K\to K$ such that $\varphi' = \varphi\circ\alpha$.
Therefore, when $G$ is nonabelain, it has two isomorphism classes when $K\cong C_9$ and one isomorphism class when $K\cong C_3\times C_3$.
I think I've solved this problem. Thanks for your help. Welcome for any comment.