首页 > 代码库 > read char

read char

  1. 技术分享
    char readchar()  
    {  
        char tmp = 0;  
        char ch;  
        bool read = false;  
        while (ch = getchar())  
        {  
            if (ch == - || ch == +)  
            {  
                read = true;  
                tmp = ch;  
            }  
            else if (read)  
            {  
                break;  
            }  
            else  
            {  
                continue;  
            }  
        }  
        return tmp;  
    }
    View Code

     

read char