Necesito este ejercicio es facil. AYUDA

rubiete_20
11 de Mayo del 2004
Dado un vector de 10 elementos, realice la inversión del mismo recursivamente en funciones.


noel solw
11 de Mayo del 2004
// program Revarr.cpp

#include <iomanip.h>
#include <iomanip.h>

const int N = 10;

void Show(int *a,char *msg)
{
cout << setw(15) << msg << " : ";
for(int i = 0;i < N;i++)
cout << setw(5) << a[i];
cout << endl << endl;
} // SHOW

void swap(int &a,int &b)
{
int c = a;
a = b;
b = c;
} // SWAP

void ReverseArray(int *a,int index)
{
if(index >= N/2)
return;
swap(a[index],a[N-1-index]);
ReverseArray(a,index+1);
}

void main()
{
int a[N] = {7,5,8,9,2,3,4,7,6,9};
Show(a,"source array");
ReverseArray(a,0);
Show(a,"reversed array");
cout << "end of program - good bye ! ! !" << endl;
} // MAIN

rubiete_20
11 de Mayo del 2004
/*
Escribir una funcion recursiva que muestre en pantalla los digitos de
un valor numerico entero positivo en orden inverso.
*/


#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

void inversa(int n);

int main()
{
int num,in;

do{
printf("Introduce numero: n");
scanf("%d",&num);
}while(num<=0);

inversa(num);



system("PAUSE");
return 0;
}


void inversa(int n)
{
printf("%d",n%10);
if(n/10!=0)
inversa(n/10);

return;
}