当前位置: 首页 > news >正文

C语言函数概述——拜佛代码

  • 函数是一种可重用的代码块,用于执行特定任务或完成特定功能
  • 函数作用:对具备相同逻辑的代码进行封装,提高代码的编写效率,实现对代码的重用
  • 函数作用演示代码:
#include <stdio.h>// 定义函数
void func() {printf("                            _ooOoo_  \n");printf("                           o8888888o  \n");printf("                           88  .  88  \n");printf("                           (| -_- |)  \n");printf("                            O\\ = /O  \n");printf("                        ____/`---'\\____  \n");printf("                      .   ' \\| |// `.  \n");printf("                       / \\||| : |||// \\  \n");printf("                     / _||||| -:- |||||- \\  \n");printf("                       | | \\\\\\ - /// | |  \n");printf("                     | \\_| ''\\---/'' | |  \n");printf("                      \\ .-\\__ `-` ___/-. /  \n");printf("                   ___`. .' /--.--\\ `. . __  \n");printf("                ."" '< `.___\\_<|>_/___.' >'"".  \n");printf("               | | : `- \\`.;`\\ _ /`;.`/ - ` : | |  \n");printf("                 \\ \\ `-. \\_ __\\ /__ _/ .-` / /  \n");printf("         ======`-.____`-.___\\_____/___.-`____.-'======  \n");printf("                            `=---='  \n");printf("  \n");printf("         .............................................  \n");printf("                  佛祖镇楼                  BUG辟易  \n");printf("          佛曰:  \n");printf("                  写字楼里写字间,写字间里程序员;  \n");printf("                  程序人员写程序,又拿程序换酒钱。  \n");printf("                  酒醒只在网上坐,酒醉还来网下眠;  \n");printf("                  酒醉酒醒日复日,网上网下年复年。  \n");printf("                  但愿老死电脑间,不愿鞠躬老板前;  \n");printf("                  奔驰宝马贵者趣,公交自行程序员。  \n");printf("                  别人笑我忒疯癫,我笑自己命太贱;  \n");printf("                  不见满街漂亮妹,哪个归得程序员?\n");}int main() {// 函数调用func();func();func();return 0;
}
  • 函数使用步骤
    • 定义函数
      • 理解为制作工具,工具只需要制作1次即可
    • 调用函数
      • 理解为使用工具
  • 函数分类
    • 系统函数,即库函数:这是由编译系统提供的,用户不必自己定义这些函数,可以直接使用它们,如我们常用的打印函数printf()。
    • 自定义函数:用以解决用户的专门需要。
http://www.lryc.cn/news/148924.html

相关文章:

  • 防火墙日志分析工具
  • Autofac中多个类继承同一个接口,如何注入?与抽象工厂模式相结合
  • Django系列之日志配置
  • 四轴飞行器传感器(SimulinkMatlab代码实现)
  • 学习 使用pandas库 DataFrame 使用
  • C++字符串详解
  • vant2 van-calendar组件增加清除按钮和确定按钮
  • Spring redis使用报错Read timed out排查解决
  • C语言每日一练-------Day(9)
  • SpringCloud(十)——ElasticSearch简单了解(三)数据聚合和自动补全
  • 二叉查找树(binary search tree)(难度7)
  • windows环境装MailHog
  • Ubuntu 22.04.2 LTS 安装python3.6后报错No module named ‘ufw‘
  • Flutter小功能实现-咖啡店
  • JavaSE 集合框架及背后的数据结构
  • -9501 MAL系统没有配置或者服务器不是企业版(dm8达梦数据库)
  • 云备份——第三方库简单介绍并使用(上)
  • MySQL数据库之索引
  • OpenCV(四):Mat支持的运算
  • WebRTC音视频通话-WebRTC推拉流过程中日志log输出
  • 用Jmeter压测问题解决
  • C语言:字符函数和字符串函数(一篇拿捏字符串函数!)
  • 问道管理:成交量买卖公式?
  • 【MySQL】5、MySQL高阶语句
  • 【Linux】redhat7.8配置yum在线源【redhat7.8镜像容器内配置yum在线源】通用
  • 强大的处理器和接口支持BL304ARM控制器
  • react 基础知识(一)
  • SpringBoot整合JUnit、MyBatis、SSM
  • virtuoso61x中集成calibre
  • com.google.guava:guava 组件安全漏洞及健康分析