问题及代码:
/*
*copyrright (c) 2014,烟台大学计算机学院
*all rights reserved
*文件名称:test.cpp
*作者:赵敏
*完成日期:2014年11月3日
*版本号:v1.0
*/
#include<iostream>
#include <cstdio>
using namespace std;
int main()
{
int a=0,b=0,o=0,c=0;
char blood;
cout<<"请输入血型:"<<endl;
cin>>blood;
while((blood=getchar())!='x')
{
switch(blood)
{
case 'A':
a++;
case 'B':
b++;
case 'O':
o++;
case 'C':
c++;
break;
}
}
cout<<"各血型数量:"<<"A:"<<a<<"B:"<<b<<"O:"<<o<<"C:"<<c<<endl;
return 0;
}
/*
*copyrright (c) 2014,烟台大学计算机学院
*a