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

C语言100天练习题【记录本】

C语言经典100题(手把手 编程)

可以在哔哩哔哩找到(url:C语言经典100题(手把手 编程)_哔哩哔哩_bilibili)

已解决的天数:一,二,五,六,八,十二,

下面的都是模模糊糊的

可以学学这些算法,我是算法白痴,但是我不是白痴

第三天(未解决)

第四天

#include <stdio.h>// 判断是否为闰年
int isLeapYear(int year) {return (year % 4 == 0 && year % 100!= 0) || (year % 400 == 0);
}int main() {int year, month, day;int days_in_month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};int total_days = 0;printf("请输入年月日:");scanf("%d %d %d", &year, &month, &day);// 判断闰年,更新二月天数if (isLeapYear(year)) {days_in_month[1] = 29;}// 计算天数for (int i = 0; i < month - 1; i++) {total_days += days_in_month[i];}total_days += day;printf("这是第%d天\n", total_days);return 0;
}

第十一天

#include <stdio.h>
//不用递归的做法
int main() {int x[20]={1,1};for (int  i = 2; i < 13; i++){x[i] = x[i-1] + x[i-2];printf("%d\n",x[i]);}return 0;
}


http://www.mrgr.cn/news/93563.html

相关文章:

  • STM32之硬件SPI
  • 苦瓜书盘官网,免费pdf/mobi电子书下载网站
  • 100天精通Python(爬虫篇)——第115天:爬虫在线小工具_Curl转python爬虫代码工具(快速构建初始爬虫代码)
  • Kubernetes Pod网络组件解析与选型指南
  • python从入门到精通(二十五):文件操作和目录管理难度分级练习题
  • 【华三】STP端口角色与状态深度解析
  • MySQL------存储引擎和用户和授权
  • 从0开始的操作系统手搓教程25:使用环状缓冲区来让我们的键盘驱动真正的有作用起来
  • 200W数据去重入库的几种方法及优缺点
  • STM32-I2C通信协议
  • Browser Use+DeepSeek的使用教程
  • LTC6804、LTC6811、LTC6813的使用
  • Linux 软硬链接
  • 音视频入门基础:RTP专题(14)——FFmpeg源码中,对H.264的各种RTP有效载荷结构的解析
  • python从入门到精通(二十四):python爬虫实现登录功能
  • 996引擎-问题处理:实现自定义道具变身卡
  • 【C++ 函数重载】—— 现代编译技术下的多态表达与性能优化
  • ubuntu22.04机器人开发环境配置
  • Elasticsearch 2025/3/7
  • 记录片《遇见大连》