当前位置:网站首页>C language example - print calendar
C language example - print calendar
2022-08-05 11:54:00 【Blue_lan18】
Write a program to display a single-month calendar.The user specifies the number of days in the month and the day of the week that the month starts.
# include int main(){int day;int i, j;int week;printf("Enter number of days in month: ");scanf("%d", &day);printf("Enter starting day of the week (1 = Sun, 7 = Sat): ");scanf("%d", &week);for(j = 1; j < week; j++){printf(" ");}//Type the space before the start of the calendar, a space is 4 bytesfor(i = 1; i <= day; i++){printf("%4d", i);if( (i + week -1) % 7 == 0){printf("\n");}// change line every 7 days}printf("\n");return 0;} 
边栏推荐
- Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?
- Keras 分割网络自定义评估函数 - mean iou
- The importance of parameter naming, remember a JDBC parameter conflict
- 多业务模式下的交易链路探索与实践
- 使用Netty编写通用redis客户端(可指定服务器地址与端口号连接任意redis)
- Reflect中的方法
- 课表小程序使用攻略
- Wingide 快捷键
- 训练集Loss收敛,但是测试集Loss震荡的厉害?
- 女人是这个世界上最美丽的生命
猜你喜欢

PHP高级检索功能的实现以及动态拼接SQL

自从用了 Kiali 以后才知道,配置 Istio 的 流量管理 是如此容易

小红的aba子序列(离散化、二分、dp维护区间最短)

澳洲站:电吹风AS/NZS 60335.2.23: 2017 安全标准测试

623. 在二叉树中增加一行 : 简单二叉树遍历运用题

普通二本毕业八年,京东就职两年、百度三年,分享大厂心得

基于NSQ搭建高可用分布式消息队列

Digital-intelligent supply chain system in the household appliance industry: efficiently integrate the supply chain and enhance the core competitiveness of household appliance enterprises

The training set Loss converges, but the test set Loss oscillates violently?

Exploration and practice of transaction link under multi-service mode
随机推荐
为了高性能、超大规模的模型训练,这个组合“出道”了
【着色器实现Flicker“DJ”闪烁效果_Shader效果第十五篇】
Monthly observation of Internet medical field in June 2022
Apache APISIX Ingress v1.5-rc1 released
knife4j
不是吧?还有人不会定位线上MySQL慢查询问题?
【硬件架构的艺术】学习笔记(3)处理多个时钟
碘乙酰胺在Desthiobiotin-Iodoacetamide试剂中的作用?
790. 数的三次方根
Go compilation principle series 9 (function inlining)
尚硅谷-JUC篇
Grid Infrastructure Installation Fails with Error
Keras 分割网络自定义评估函数 - mean iou
Flink Yarn Per Job - JobManger 申请 Slot
力扣330 按要求补齐数组(贪心)
Face the summary - club resort - 6 years
尚硅谷-JVM-性能监控与调优篇(P302~P381)
795. 前缀和
STM32H743IIT6学习笔记02——USART
Zhihu asks: Can China still achieve great national rejuvenation?