Varianta 62 / Subiectul 3 / Problema 4 |
#include<fstream.h> ifstream fin("date.in"); ofstream fout("date.out"); int f[100]; void main() { int i,x; while(fin>>x) f[x]++; for(i=1;i<=99;i=i+2) if(f[i]!=0) fout<<i<<" "; fout<<endl; for(i=98;i>=0;i=i-2) if(f[i]!=0) fout<<i<<" "; fout.close(); } |