c++ 原来的 头文件 保持不变,后面加一句 #include <stdio.h>
就可使用 scanf(),而且仍然可以使用 cout ,甚至 一会儿 用 c, 一会儿 用 c++.
实质上 , c 是 c++ 的 一部分 (c++ 是在 c 的基础上 加了又加 制造出来的).
例如:
#include<iostream>
#include<fstream>
#include <string>
using namespace std;
#include <stdio.h>
。。。其它什么都不用改。。。
温馨提示:答案为网友推荐,仅供参考