Elastic and single-charge-exchange scattering of pions by carbon nuclei