返回列表 發帖
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. ifstream ifs;
  4. ofstream ofs;
  5. int n;
  6. vector<int>v;
  7. int main()
  8. {
  9.     ifs.open("read.txt");
  10.     ofs.open("write.txt");
  11.     for(int i0;i<4;i++)
  12.     {
  13.         cin>>n;
  14.         v.push_back(n);
  15.     }
  16.     while(ifs>>n)
  17.         v.push_back(n);
  18.     sort(begin(v),end(v));
  19.     for(int i:v)
  20.     {
  21.         cout<<i<<'\n';
  22.         ofs<<i<<'\n\;
  23.     }
  24.     return 0;
  25. }
複製代碼

TOP

返回列表