fork(3) download
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int n;
  9. cin >> n;
  10. int b[n], a;
  11. for (int i = n; i >= 0; --i)
  12. {
  13. cin >> a;
  14. b[i] = a * i;
  15. }
  16. for (int i = n; i >= 0; --i)
  17. {
  18. cout << b[i] << ' ';
  19. }
  20. cout << endl;
  21. }
Success #stdin #stdout 0s 3300KB
stdin
3
0 0 0 0
stdout
0 0 0 0