我偏偏不用数组!引入了静态局部变量i也能解决问题!!!
#include <iostream>
using namespace std;
int main()
{
int c;
while((c=getchar())!='\n')
{
static int i=0;//在循环中运用static声明静态局部变量i来判定字符是否处在首位
if(i!=0)//如果不在首位,就在要输出的拼音前加空格
{
switch(c)
{
case '-':cout<<" fu";break;
case '+':cout<<" zheng";break;
case '0':cout<<" ling";break;
case 49:cout<<" yi";break;//ASCII码和字符是等效的!
case '2':cout<<" er";break;
case '3':cout<<" san";break;
case '4':cout<<" si";break;
case '5':cout<<" wu";break;
case '6':cout<<" liu";break;
case '7':cout<<" qi";break;
case '8':cout<<" ba";break;
case '9':cout<<" jiu";break