1. 程式人生 > >第16周閱讀程式——2(1)

第16周閱讀程式——2(1)

/*
*Copyright (c) 2016,煙臺大學計算機學院
*All rights reserved.
*檔名稱 :
*作 者 : 劉雲
*完成日期 : 2016年6月15號
*版 本 號 : v6.0
*
*問題描述 :  閱讀程式
*輸入描述 :無
*程式輸出 :
*/
#include<iostream>
#include<fstream>
#include<cstdlib>
using namespace std;
int main()
{
   int a;
   ofstream outfile("f1.dat",ios::out);
   if(!outfile)
   {
       cerr<<"open error!"<<endl;
       exit(1);
   }
   cin>>a;
   outfile<<a<<endl;
   outfile.close();
    return 0;
}