Skip to content

Commit

Permalink
ex5_10:default switch behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
zbjdonald authored and pezy committed Apr 26, 2015
1 parent 8955162 commit 1af079f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ch05/ex5_10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@ int main()
unsigned aCnt = 0, eCnt = 0, iCnt = 0, oCnt = 0, uCnt = 0;
char ch;
while (cin >> ch)
switch (tolower(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;
}
Expand Down

0 comments on commit 1af079f

Please sign in to comment.