問答題

寫出下列程序的輸出結(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);}


您可能感興趣的試卷

你可能感興趣的試題

2.單項選擇題與語句while(!s)中的條件等價的是()。

A.s==0
B.s!=0
C.s==1
D.s=0