为什么运行不起来呢?

#include <stdio.h>
#include <stdlib.h>
int main()
{
    char a;
    a=getche( );
    printf ("%c",a);

    return 0;
}

a=getchar();

注意你的a=getche()

是我解错了,我以为你想输入getchar(),只是拼写错了(所以我让你看这个,其实我也没错,今天贴出另外一种情况的解决),今天查询资料发现getche()有这个函数。

从你的代码角度看有两种,第一种是getchar,第二种是getche(),只不过你调用的库错了

#include <stdio.h>
#include <conio.h>
int main()
{
    char a;
    a=getche();
    printf ("%c",a);
    return 0;
}