C:获取屏幕输入

代码:

#include "stdafx.h"
#include "stdio.h"

int _tmain(int argc, _TCHAR* argv[])
{
    char buf[1024];

    while(fgets(buf,1024,stdin)!=NULL){
        printf("%s %s","你输入了:",buf);
    }
    return 0;
}

输出:

1234*23
你输入了: 1234*23
2+5
你输入了: 2+5

--2020年6月6日--

原文地址:https://www.cnblogs.com/heyang78/p/13054724.html