#include <stdio.h>
int main(void){
int c, bl, tl, nl;
bl = 0;
tl = 0;
nl = 0;
printf("Input some characters, then press Ctrl+D./n");
while ((c = getchar()) != EOF){
if (c == ' ')
++bl;
else if (c == '/t')
++tl;
else if (c == '/n')
++nl;
}
printf("Count of blanks is %d, count of tabs is %d, count of newlines is %d./n", bl, tl, nl);
return 0;
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266652.html