fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. size_t n;
  6. cin >> n;
  7. double *x = new double [n];
  8. for(size_t i = 0; i < n; i++)
  9. cin >> x[i];
  10.  
  11. // Processing
  12.  
  13. for(size_t i = 0; i < n; i++)
  14. cout << "x[" << i << "] = " << x[i] << "\t";
  15. delete [] x; // очистка памяти
  16. }
Success #stdin #stdout 0s 3476KB
stdin
5
1 3 2 4 5
stdout
x[0] = 1	x[1] = 3	x[2] = 2	x[3] = 4	x[4] = 5