CON_VOWL.C
资源名称:C.rar [点击查看]
上传用户:qq5388545
上传日期:2022-07-04
资源大小:29849k
文件大小:0k
源码类别:
界面编程
开发平台:
C/C++
- #include <stdio.h>
- void main()
- {
- char letter;
- int vowel_count = 0;
- int consonant_count = 0;
- for (letter = 'A'; letter <= 'Z'; letter++)
- switch (letter) {
- case 'A':
- case 'E':
- case 'I':
- case 'O':
- case 'U': vowel_count++;
- break;
- default: consonant_count++;
- };
- printf("The number of vowels is %dn", vowel_count);
- printf("The number of vowels is %dn", consonant_count);
- }