摘要:
c语言中数字字符计数。 1、 #include <stdio.h> int main(void) { int i, ch; int cnt[10] = {}; while((ch = getchar()) != EOF) { switch(ch) { case '0': cnt[0]++; brea 阅读全文
摘要:
c语言中将输入的字符直接输出 getchar函数 和EOF getchar函数用于读取字符并返回,(getchar和putchar都只处理一个字符); EOF是对象式宏,为一个负值。 1、 #include <stdio.h> int main(void) { int ch; while((ch = 阅读全文
摘要:
1、 #include <stdio.h> int main(void) { int ch; int time[1] = {}; while((ch = getchar()) != EOF) { switch(ch) { case '\n': time[0]++; break; } } printf 阅读全文