fork(7) download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int t;
  5. cin >> t;
  6. while(t--) {
  7. int n;
  8. cin >> n;
  9. long long ans = 1;
  10. for(int i=1;i<=n;i++) {
  11. long long x;
  12. cin >> x;
  13. ans = ans * x;
  14. }
  15. cout << ans << endl;
  16. }
  17. }
Success #stdin #stdout 0s 4532KB
stdin
1
2
2 2
stdout
4