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

查看所有标签

Google API开发详解

Google API开发详解

江宽,龚小鹏等编 / 电子工业 / 2008-1 / 59.80元

《Google API开发详解:Google Maps与Google Earth双剑合璧》从易到难、由浅入深、循序渐进地介绍了Google Maps API和Google Earth API的开发技术。《Google API开发详解:Google Maps与Google Earth双剑合璧》知识讲解通俗易懂,并有大量的实例供读者更加深刻地巩固所学习的知识,帮助读者更好地进行开发实践。 《Go......一起来看看 《Google API开发详解》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具