Solution (source code)

= Solution

Form a <bipartite graph> with one vertex for each row and one for each column, putting an edge $ij$ exactly where $a_{ij}>0$. For a set $S$ of row vertices, let $N(S)$ be its neighbouring column vertices. Since $A$ is a <doubly stochastic matrix>,
$$
|S|=\sum_{i\in S}\sum_j a_{ij}=\sum_{j\in N(S)}\sum_{i\in S}a_{ij}\leq\sum_{j\in N(S)}\sum_i a_{ij}=|N(S)|.
$$
The <Hall marriage theorem> therefore supplies a <perfect matching>. Its incidence entries define a <permutation matrix> $P$ supported on the positive entries of $A$, hence on the ones of $B$. Entrywise $P\leq B$, so
$$
\boxed{B=P+C,\qquad C=B-P\geq0.}
$$