检测输入的字符是否为“g”

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xh_xinhua/article/details/53366502

检测输入的字符是否为“g”

#include <stdio.h>
int main(void)
{
    printf("input a char\n");
do{
    printf("%s.%d you come here , input g \n", __FUNCTION__, __LINE__);
    if (getchar() == 'g')
    {
        break;
    }
}while(1);
return 0;//最后返回成功,哈哈哈!
}

猜你喜欢

转载自blog.csdn.net/xh_xinhua/article/details/53366502