Facebook
From Queen Peafowl, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 154
  1. #include <fstream>
  2. #include <algorithm>
  3. using namespace std;
  4. ifstream f("sort2.in");
  5. ofstream g("sort2.out");
  6. int x,n,v[110],j;
  7. bool ok=0;
  8. int main()
  9. {
  10.     while(f>>x)
  11.     {
  12.         if(x<100)
  13.             v[++j]=x,ok=1;
  14.  
  15.     }
  16.     if(ok==0)
  17.     {
  18.         g<<"NU EXISTA";
  19.         return 0;
  20.     }
  21.     sort(v+1,v+j+1);
  22.     for(int i=1; i<=j; ++i)
  23.         g<<v[i]<<" ";
  24.  
  25.  
  26.  
  27.     return 0;
  28. }
  29.