⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 11-4-2-1.cpp

📁 学习c++的ppt
💻 CPP
字号:
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
void main()
{  char  filename[10]; 
    cout << "输入文件名:";
    cin >> filename;
    ifstream  ifile(filename, ios::in|ios::nocreate);
    ofstream ofile("result.txt");
    if(! ifile)  {
         cout << "文件不存在" << endl;
         exit(0);
   }
   if(! ofile)  {
           cout << "Result.dat 文件不能建立!" << endl;
           exit(0);
   }
   int  n;
   while(ifile >> n)  ofile << 10 *n << ' ';
   ifile.close();
   ofile.close();
}

⌨️ 快捷键说明

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