//chcount.c -- 使用逻辑与运算符
#include <stdio.h>
#define PERIOD '.'
int main(int argc, const char * argv[]) {
char ch;
int charcount=0;
while ((ch=getchar())!=PERIOD)
{
if (ch!='"'&&ch!='\'') {
charcount++;
}
}
printf("There are %d non-quote characters.\n",charcount);
return 0;
}
chcount.c
最新推荐文章于 2024-07-18 11:11:00 发布