首页
非编软件哪个最好用(非编系统)
返回

非编软件哪个最好用(非编系统)

2023-01-03 百科达人 By:佚名
最佳答案大家好,小问来为大家解答以上问题。非编软件哪个最好用,非编系统这个很多人还不知道,现在让我们一起来看看吧!1、因为涉及到怎么置光标位置的问题,现在还做不出来,下面的程序是c++的。2、你看一下他是输入粘合月求一个月的日历,我再用C试一下//输入年月求该月日历#include #include using names...

大家好,小问来为大家解答以上问题。非编软件哪个最好用,非编系统这个很多人还不知道,现在让我们一起来看看吧!

1、因为涉及到怎么置光标位置的问题,现在还做不出来,下面的程序是c++的。

2、你看一下他是输入粘合月求一个月的日历,我再用C试一下//输入年月求该月日历#include #include using namespace std; class calendarType { private: int year; int month; int days; public: calendarType(int Year = 1500, int Month = 1); void setYear(int Year); void setMonth(int Month); int getYear(); int getMonth(); int getDays(int Year, int Month); bool IsLeapYear(int Year); void disCalendar(int Year, int Month); }; calendarType::calendarType(int Year, int Month) { if (Year < 1500 || Year > 3000) year = 1500; else year = Year; if (Month > 12 || Month < 1) month = 1; else month = Month; getDays(year, month); } void calendarType::setYear(int Year) { if (Year >= 1500 && Year <= 3000) year = Year; } void calendarType::setMonth(int Month) { if (Month >=1 && Month <= 12) month = Month; } inline int calendarType::getYear() { return year; } inline int calendarType::getMonth() { return month; } int calendarType::getDays(int Year, int Month) { switch(Month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: days = 31;break; case 4: case 6: case 9: case 11: days = 30; break; case 2: if (IsLeapYear(Year)) days = 29; else days = 28; } return days; } //判断闰年 bool calendarType::IsLeapYear(int Year) { if ((Year % 4 == 0 && Year % 100 != 0) || Year % 400 == 0) return true; else return false; } //输出函数 void calendarType::disCalendar(int Year, int Month) { int totalDays = 0; for (int i = 1500; i < Year; i++) { if (IsLeapYear(i)) totalDays += 366; else totalDays += 365; } for (i = 1; i < Month; i++) { totalDays += getDays(Year, i); } totalDays++; int week = totalDays % 7; cout << setw(30) << Year << "年" << Month << "月"; cout << endl; cout << setw(8) << "Sun"; cout << setw(8) << "Mon"; cout << setw(8) << "Tue"; cout << setw(8) << "Wed"; cout << setw(8) << "Thu"; cout << setw(8) << "Fri"; cout << setw(8) << "Sat"; cout << endl; week++; if (week > 7) week = 1; for (i = 1; i < week; i++) cout << setw(8) << ""; getDays(Year, Month); for (i = 1; i <= days; i++) { if (week > 7) {cout << endl; week = 1; } cout << setw(8) << i; week++; } } //主函数 int main() { int year, month; cout << "输入需要查询的年和月:"; cout << flush; cin >> year >> month; calendarType Cal(year, month); Cal.disCalendar(year, month); getchar(); getchar(); return 0; }。

以上就是【非编软件哪个最好用,非编系统】相关内容。

猜你喜欢
蒸面包蟹需要多长时间

蒸面包蟹需要多长时间

12-19 0 阅读
pvc水管冻了怎么快速解冻

pvc水管冻了怎么快速解冻

07-22 0 阅读
我国海域从北向南有什么海

我国海域从北向南有什么海

07-26 0 阅读
成都靠谱的寻车公司是哪一个?

成都靠谱的寻车公司是哪一个?

12-05 0 阅读
笔记本可以连蓝牙耳机吗

笔记本可以连蓝牙耳机吗

12-19 0 阅读
拼多多可以查别人的订单吗

拼多多可以查别人的订单吗

12-20 0 阅读
热门推荐
蒸面包蟹需要多长时间

蒸面包蟹需要多长时间

12-19 0 阅读
pvc水管冻了怎么快速解冻

pvc水管冻了怎么快速解冻

07-22 0 阅读
疯狂的麦穗儿(关于疯狂的麦穗儿的基本详情介绍)

疯狂的麦穗儿(关于疯狂的麦穗儿的基本详情介绍)

01-02 0 阅读
苦荞和荞麦有区别(荞麦和苦荞一样吗)

苦荞和荞麦有区别(荞麦和苦荞一样吗)

12-30 0 阅读
星子镇中心小学(关于星子镇中心小学的简介)

星子镇中心小学(关于星子镇中心小学的简介)

12-31 0 阅读
相对剩余价值生产(相对剩余价值)

相对剩余价值生产(相对剩余价值)

01-01 0 阅读
景德镇地震(关于景德镇地震的基本详情介绍)

景德镇地震(关于景德镇地震的基本详情介绍)

01-02 0 阅读
我国海域从北向南有什么海

我国海域从北向南有什么海

07-26 0 阅读
帆水母(关于帆水母的基本详情介绍)

帆水母(关于帆水母的基本详情介绍)

01-01 0 阅读
退避三舍的故事(关于退避三舍的故事的基本详情介绍)

退避三舍的故事(关于退避三舍的故事的基本详情介绍)

01-01 0 阅读