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");
}

  

posted @ 2018-07-01 23:13  lifeless_faultless  阅读(312)  评论(0)    收藏  举报