C++.


switch - 4


/p>

}

, :

switch ( ch )

{

//

case 'a': case 'e':

case 'i': case 'o': case 'u':

++vowe1Cnt;

break;

}

:

UNIX

, U I . :

switch ( ch ) {

case 'a': case 'A':

++aCnt;

break;

case 'e': case 'E':

++eCnt;

break;

case 'i': case 'I':

++iCnt;

break;

case 'o': case 'O':

++oCnt;

break;

case 'u': case 'U':

++uCnt;

break;

}

default

else if-else. , default, , case. , :

#include <iostream>

#include <ctype.h>

 

int main()

{

char ch;

int aCnt=0, eCnt=0, iCnt=0, oCnt=0, uCnt=0,

consonantCount=0;

 

while ( cin >> ch )

switch ( ch ) {

case 'a': case 'A':

++aCnt;

break;

case 'e': case 'E':

++eCnt;

break;

case 'i': case 'I':

++iCnt;

break;

case 'o': case 'O':

++oCnt;

break;

case 'u': case 'U':

++uCnt;

break;

default:

if ( isa1pha( ch ) )

++consonantCnt;

break;

}

 

cout << " a: \t" << aCnt << '\n'

<< " e: \t" << eCnt << '\n'

<< " i: \t" << iCnt << '\n'

<< " o: \t" << oCnt << '\n'

<< " u: \t" << uCnt << '\n'

<< " : \t" << consonantCnt

<< '\n';

<