文件输出示例 include <fstream.h> void main o char *name =QWERTY POIUYT i int age 49; float salary 600.123f; ofstream fout (TEST. TXT) fout<<"行写入了TES.xT中\n"; fout < name < "l<< age < " << salary i fout closed 北大青鸟8 文件输出示例 #include <fstream.h> void main() { char *name = "QWERTY POIUYT"; int age = 49; float salary = 600.123f; ofstream fout ("TEST.TXT"); fout << "此行写入了 TEST.TXT 中\n"; fout << name << " " << age << " " << salary; fout.close(); }