switch雍惋句的应用.pptVIP

  • 3
  • 0
  • 约9.87千字
  • 约 40页
  • 2017-10-18 发布于浙江
  • 举报
switch雍惋句的应用

示例: 输入10个字符,分别统计出其中空格或回车、数字和其他字符的个数。 for(i = 1; i = 10; i++){ ch = getchar(); switch (ch) { case ‘?‘ : case ’\n‘ : blank ++; break; case 0 : case 1 : case 2 : case 3‘: case 4 : case 5 : case 6 : case 7 : case 8 : case 9 : digit ++; break; default: other ++; break; } } printf(“blank=%d, digit=%d, other=%d\n”, blank, digit, other); } if(flag==1) { printf(\n\n*****************

文档评论(0)

1亿VIP精品文档

相关文档