1 #include <iostream>
 2 #include <fstream>
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 int main(int argc, char** argv) {
 6     int a[10];
 7     ofstream outfile("f1.dat",ios::out);
 8     if(!outfile)
 9     {
10         cerr<<"open error!"<<endl;
11         exit(1);
12     }
13     cout<<"enter 10 integer numbers:"<<endl;
14     for(int i=0;i<10;i++)
15     {
16         cin>>a[i];
17         outfile<<a[i]<<" ";
18     }
19     outfile.close();
20     return 0;
21 }

 

相关文章:

  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2021-07-13
  • 2021-12-27
  • 2021-08-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2022-02-16
  • 2021-04-09
  • 2021-12-08
  • 2022-02-13
  • 2021-06-10
  • 2022-12-23
相关资源
相似解决方案