fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4. int size;
  5. long long int mul=1;
  6. cin>>size;
  7. int arr[size];
  8. for(int i=0;i<size;++i){
  9. cin>>arr[i];
  10. mul=(mul*1LL*arr[i]) % 1000000007;
  11. }
  12. cout<<mul;
  13.  
  14. return 0;
  15.  
  16. }
Success #stdin #stdout 0s 5312KB
stdin
5
1 2 3 4 5 
stdout
120