Classification of surfaces

If I read correctly you are trying to determine $c$ and $g$, given a compact connected surface $M$ for which you know $b$ the number of boundary components, $\chi(M)$ the Euler characteristic the and whether or not $M$ is orientable.

This can't be done in a unique manner, as the connected sum of a tori and a projective plan is homeomorphic to the connected sum of three projective planes.

Please correct me if I misunderstood your question.


Since $\mathbb{R}P^2\# \mathbb{R}P^2\#\mathbb{R}P^2\cong \mathbb{R}P^2 \# T^2$, $c$ and $g$ are not uniquely determined: if $c\geq 3$, you can subtract $2$ from $c$ and add $1$ to $g$ and get the same surface, or if $c,g\geq 1$, you can subtract $1$ from $g$ and add $2$ to $c$.

Note, though, that the first operation can always be used to get a connected sum presentation where $c\leq 2$. If you impose the additional restriction that $c\leq 2$, then $c$ and $g$ can be uniquely determined and can be calculated from the data you mention. If the surface is orientable, then $c=0$ and then you can just solve for $g$. If the surface is not orientable, then you can determine whether $c=1$ or $c=2$ since $c$ must have the same parity as $\chi(M)+b$. Once $c$ is determined, you can solve for $g$.