记录一下我找到的答案:https://askubuntu.com/questions/525051/how-do-i-use-graphics-h-in-ubuntu
可以使用bochs安装一个模拟器,里面安装borland c++/turbo c。