C 练习实例27

C 语言教程 · 2019-02-21 18:42:27

题目:利用递归函数调用方式,将所输入的5个字符,以相反顺序打印出来。

程序分析:无。

实例

// Created by www.codercto.com on 15/11/9. // Copyright © 2015年 码农教程. All rights reserved. // #include <stdio.h> int main() { int i=5; void palin(int n); printf("请输入5个字符\40:\40"); palin(i); printf("\n"); } void palin(n) int n; { char next; if(n<=1) { next=getchar(); printf("相反顺序输出结果\40:\40"); putchar(next); } else { next=getchar(); palin(n-1); putchar(next); } }

以上实例输出结果为:

请输入5个字符 : abcde
相反顺序输出结果 : edcba

点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html

查看所有标签

Flexible Pattern Matching in Strings

Flexible Pattern Matching in Strings

Gonzalo Navarro、Mathieu Raffinot / Cambridge University Press / 2007-7-30 / USD 64.99

String matching problems range from the relatively simple task of searching a single text for a string of characters to searching a database for approximate occurrences of a complex pattern. Recent ye......一起来看看 《Flexible Pattern Matching in Strings》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

URL 编码/解码
URL 编码/解码

URL 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换