首页 > 解决方案 > C程序没有输出

问题描述

我在运行我的 C 字符计数程序时遇到了一些问题。

我想知道为什么无论输入是什么都没有输出。这是我的程序:

#include <stdio.h>

int main(void)
{
    int nc = 0;
    while (getchar() != EOF)
    {
       ++nc;
    }
    printf("%d\n", nc);
    return 0;
}

标签: c

解决方案


推荐阅读