fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void imprimir (int B[], int indice, int size, int max){
  6.  
  7. if(indice >= size){
  8. cout << max << "\n";
  9. return;
  10. }
  11. if(B[indice] > max){
  12. max = B[indice];
  13. }
  14. imprimir(B, indice + 1, size, max);
  15. }
  16.  
  17. int main() {
  18.  
  19. int n;
  20. int A[n];
  21. cin>> n;
  22.  
  23. for(int i = 0; i < n; i++){
  24. cin >> A[i];
  25. }
  26.  
  27. imprimir(A, 0, n, A[0]);
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
2147479976