把做工程过程中重要的内容记录起来,下边内容是关于C语言基础:switch条件语句使用范例的内容。
#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); }