void printArray(int a[],int n){ for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl; }
for (auto i : a){ //C++11 cout << i<< " "; }