reverse c

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

char String[30];
int Length;

void Reverse(int N)
{
    if (N < Length)
    {
     Reverse(N + 1);
     printf("%c", String[N]);
    }
}

void main()
{
    printf("Please enter string : ");
    scanf("%s", &String);

    Length = strlen(String);
    printf("The reverse string : ");
    Reverse(0);
    printf("\n");
}

  

猜你喜欢

转载自www.cnblogs.com/lifelessfaultless/p/9251790.html