寫出下列程序的輸出結(jié)果。#include<stdio.h>voidmain(){charx;intn=0,k=0;while((x=getchar())!=’#’){//運行時輸入:athefthethethere#switch(x){case’t’:k++;break;case’h’:if(k==1)k++;break;case’e’:if(k==2)k++;break;default:k=0;}if(k==3)n++;}printf("%d\n",n);}
A.8次 B.10次 C.2次 D.無數(shù)次