p14.cpp

来自「数据结构各种算法的实现」· C++ 代码 · 共 13 行

CPP
13
字号
#include <fstream.h>
#include <stdlib.h>
#include <process.h>

void main() {
    ofstream outFile ("my.out");
    if (! outFile ) {
	cout << "Cannot open my.out" << endl; exit(1);
    }
    int n = 50; float f = 20.3;
    outFile << "n:" << n << endl;
    outFile << "f:" << f << endl;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?