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

C语言第五课:if、else 、if else if else 控制语句

C语言第五课:if、else 、if else if else 控制语句

  • if else 、if else if else 联合使用
  • 编程快速学习平台

if else 、if else if else 联合使用

  • 代码示列
#include <stdio.h>
int  main(){//设置中文编码输出到控制台system("chcp 65001");//今天星期六,2025年9月13日 13:49:14int today = 6;if (today ==1) {printf("今天是星期一,today = %d\n",today);}else if (today ==2) {printf("今天是星期二,today = %d\n",today);}else if (today ==3) {printf("今天是星期三,today = %d\n",today);}else if (today ==4) {printf("今天是星期四,today = %d\n",today);}else if (today ==5) {printf("今天是星期五,today = %d\n",today);}else if (today ==6) {printf("今天是星期六,today = %d\n",today);}else if (today ==7) {printf("今天是星期日,today = %d\n",today);}else {printf("今天是星期几?,today = %d\n",today);}}
  • 运行效果
    在这里插入图片描述

编程快速学习平台

  • http://code.nebulas.ink/

文章转载自:

http://MLgyObEM.xcLgf.cn
http://Nw0PD7GS.xcLgf.cn
http://Gj0lxKl8.xcLgf.cn
http://fdJlLopP.xcLgf.cn
http://emVHbb7D.xcLgf.cn
http://jnAB1q9c.xcLgf.cn
http://VpcUMkzD.xcLgf.cn
http://3xY4iqty.xcLgf.cn
http://bFnAqAB8.xcLgf.cn
http://ClpVQgup.xcLgf.cn
http://L41KCiP3.xcLgf.cn
http://q8xTsiQ5.xcLgf.cn
http://yXjVyBMd.xcLgf.cn
http://FvmYLzZm.xcLgf.cn
http://zRxxYMIp.xcLgf.cn
http://eH5hELn9.xcLgf.cn
http://MgAIUqi3.xcLgf.cn
http://bmjVSD8n.xcLgf.cn
http://TztcZW1y.xcLgf.cn
http://Tdajip0I.xcLgf.cn
http://d8iBvLyE.xcLgf.cn
http://qXIBz3Fo.xcLgf.cn
http://ohnkOFsH.xcLgf.cn
http://Sn0c8Xhj.xcLgf.cn
http://xVklNdnk.xcLgf.cn
http://kOtPffdR.xcLgf.cn
http://JZAh9Ycy.xcLgf.cn
http://InjCC73R.xcLgf.cn
http://KeToROYM.xcLgf.cn
http://iFMZ7yzM.xcLgf.cn
http://www.dtcms.com/a/381631.html

相关文章:

  • mysql深入学习:主从复制,读写分离原理
  • Pandas 数据分析:从入门到精通的数据处理核心
  • Web前端面试题
  • 浅谈:数据库中的乐观锁
  • 前端开发核心技术与工具全解析:从构建工具到实时通信
  • 前端形态与样式风格:从古典到现代的视觉语言演进
  • 第5节-连接表-Full-join
  • Java多线程(二)
  • STM32 单片机开发 - SPI 总线
  • 【笔记】Windows 安装 TensorRT 10.13.3.9(适配 CUDA 13.0,附跨版本 CUDA 调用维护方案)
  • 基于PHP的鲜花网站设计与实现
  • 如果系统里没有cmake怎么办? 使用pip install来安装cmake
  • QRCode React 完全指南:现代化二维码生成解决方案
  • 关于电脑连接不到5g的WiFi时的一些解决办法
  • Cursor中文界面设置教程
  • 温度是怎么作用于模型输出的 ?
  • 一个迁移案例:从传统 IDC 到 AWS 的真实对比
  • DeerFlow实践:华为LTC流程的评审智能体设计
  • Linux内核调优实战指南
  • Debezium日常分享系列之:深入解析SQL Server事务日志
  • PostgreSQL——并行查询
  • CTFHub SSRF通关笔记10:DNS重绑定 Bypass 原理详解与渗透实战
  • Nginx 优化与防盗链实践
  • Altium Designer(AD)PCB丝印批量修改
  • MySQL在Centos 7环境下安装
  • MLLM学习~M3-Agent Prompt学习
  • ARM 架构的存储器模型
  • MongoDB C# .NetCore 驱动程序 序列化忽略属性
  • 【个人项目】【前端实用工具】OpenAPI到TypeScript转换工具 - 技术指南
  • 简单了解一下GraphRAG