当前位置:网站首页>day(0~6)代表每月第一天起始位置,stop代表每月天数,每天之间空两个空格。输入不同的day和stop,输出每月日历的样子。假设day为2,stop为31,则输出样式为
day(0~6)代表每月第一天起始位置,stop代表每月天数,每天之间空两个空格。输入不同的day和stop,输出每月日历的样子。假设day为2,stop为31,则输出样式为
2022-07-24 05:16:00 【陌小呆^O^】
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int day, stop;
int date = 1;
cout << "输入每月第一天位置:";
cin >> day;
cout << "输入每月天数:";
cin >> stop;
cout << " Sun Mon Tue Wed Thu Fri Sat\n";
if (day != 0)
cout << setw(day * 5) << " ";
while (date <= stop)
{
cout << setw(5) << date;
date++;
if ((date + day) % 7 == 1)
cout << "\n";
}
return 0;
}边栏推荐
猜你喜欢

Pure white tutorial using Druid database connection pool in idea

Echo speaker pairing and operation method

T 6-10

Hotel IPTV digital TV system solution

I'm interested in reading efficient reading - the most cost-effective self investment

Tips for using the built-in variable props of BeanShell

1. Pedestrian recognition based on incremental occlusion generation and confrontation suppression

C语言入门篇 一.分支和循环语句

C语言进阶篇 三.字符串函数和内存操作函数

T 11-20
随机推荐
一步一步带你学C(其一)
5.模板缓存,绘制一个正方形只能在三角形内移动
【dp】数字三角形
jdbc的增删改查
MySQL深入了解
ssm的整合
View progress!!! RPM installation!!!
空杯心态,重新开始
Redis的使用
线程的介绍
jdbc封装一个父类减少代码重复
6.在屏幕上绘制一条贝塞尔曲线和一个贝塞尔曲面
Pointer learning diary (II)
C语言从入门到入土——操作符超详细总结
4. 在屏幕上绘制一个红色三角形,一个黄色正方形。三角形在后,小;正方形在前,大。使用融合技术,使得可以透过正方形看到三角形,源和目标融合因子分别为GL_SRC_ALPHA和GL_ONE_MINUS
The opening ceremony of the 2022 Huawei developer competition in China kicked off!
反射
C语言入门篇 概述
Skills of BeanShell dealing with JSON
AiN 0722 签到