C++实战项目:日期计算器的实现

news2024/9/28 7:17:41

前言

Hello,小伙伴们,经过了前面对C++基础知识的学习,我们今天就着重运用一下前面学习到的知识,来通过类和对象以及运算符重载的部分知识来实现,来完成我们的日期计算器。

日期计算器,顾名思义,就是可以通过日期和天数来进行年、月、日的转换、计算。

1.可以实现具体日期与天数的加减,并得到加减计算后的日期。

2.可以实现两个具体日期之间的加减,计算两日期之间相差的天数。

 功能不是特别的复杂,我们现在就可以着手尝试了。

好,按例三连上车不迷路,开始我们今天的内容。

在看这篇文章的时候,强烈推荐大家先看看我之前的这两篇文章,来学习一下C++类和对象的基础:
http://t.csdnimg.cn/OY9mJ

http://t.csdnimg.cn/ZK1sA

1.日期类的定义

首先我们要定义一个日期类,运用我们刚学习的C++知识,我们这里直接看代码:

案例,我们还是先创建3个文件来实现我们的目的

#pragma once
#include<iostream>
#include<assert.h>
class Date
{
public:
	Date(int year = 2024, int month = 8, int day = 16);
	//~Date();

private:
	int _year;
	int _month;
	int _day;
};



在这里,我们先来解决构造函数和析构函数的问题:

构造函数:

我们在Date.cpp文件中实现他的功能:

Date::Date(int year, int month, int day)
{
	_year = year;
	_month = month;
	_day = day;
}

由于在日期类中,我们没有申请内存空间,也就是该类中不存在深度拷贝,因此我们就不需要自己单独实现析构函数。

 2.日期类的打印(DatePrint)

完成构造函数后,我们就可以通过打印函数来显示我们定义的日期类的值:

首先我们要完成日期打印函数的声明: 

#pragma once
#include<iostream>
#include<assert.h>
class Date
{
public:
	Date(int year = 2024, int month = 8, int day = 16);
	//~Date();
    void DatePeint();//日期打印
private:
	int _year;
	int _month;
	int _day;
};



 接下来我们来实现日期类打印函数的功能:

void Date::DatePrint()
{
	cout << _year << "/" << _month << "/" << _day << endl;
}

接下来我们来展示一下这个函数的功能:

3.比较运算符的重载 

前面我们学习了运算符重载方面的知识,我们接下来就设计及应用一下:

比较运算符的种类有很多,但是在运算符重载上实现的方法基本一样,这里借用我们前面学到的知识很容易就能实现:
 

#pragma once
#include<iostream>
#include<assert.h>
class Date
{
public:
	Date(int year = 2024, int month = 8, int day = 16);
	//~Date();
    void DatePeint();//日期打印
//比较大小运算符的重载
bool operator==(Date& d);
bool operator!=(Date& d);
bool operator>(Date& d);
bool operator<(Date& d);
bool operator<=(Date& d);
bool operator>=(Date& d);
private:
	int _year;
	int _month;
	int _day;
};



代码实现:

bool Date::operator==(Date& d)
{
	return _year == d._day 
		&& _month == d._month
		&& _day == d._day;
}
Date& Date::operator=(const Date& d1)
{
	
		_year = d1._year;
		_month = d1._month;
		_day = d1._day;

	return *this;

}

bool Date::operator!=(Date& d)
{
	return !(*this == d);
}
bool Date::operator>(Date& d)
{
	if (_year > d._year )
	{
		return true;
	}
	else if (_year == d._year && _month >d._month)
	{
		return true;
	}
	else if (_year == d._year && _month == d._month && _day > d._day)
	{
		return true;
	}
	return false;
}
bool Date::operator<(Date& d)
{
	return !(*this >= d);
}
bool Date::operator<=(Date& d)
{
	return *this < d || *this == d;
}
bool Date::operator>=(Date& d)
{
	return *this > d || *this == d;
}

运算符重载的实现逻辑十分的灵活,我们只需要实现几种基本的运算符重载,其他的我们就能够根据已知的运算关系,并运用或且非的逻辑关系来实现其余的运算符重载。

 4.日期+= 和 +操作(日期加天数)的实现

首先我们还是先来定义这个运算符的重载:

 要实现日期与天数的加操作,我们就好要得到每个月的天数:

#pragma once
#include<iostream>
#include<assert.h>
class Date
{
public:
	Date(int year = 2024, int month = 8, int day = 16);
	//~Date();
    void DatePeint();//日期打印
//比较大小运算符的重载
bool operator==(Date& d);
bool operator!=(Date& d);
bool operator>(Date& d);
bool operator<(Date& d);
bool operator<=(Date& d);
bool operator>=(Date& d);
//获取每个月的天数
int GetMonthDay(int year, int month)
{
	assert(month >= 1 && month <= 12);
	//因为这个数组会高频·的进行调用,所以使用静态数组就能极大地提高效率
	static int MonthDay[13] = { -1, 31,28, 31 ,30, 31,30, 31, 31, 30, 31, 30, 31 };
	//借用短路效应,适当的提高效率
	if ( month == 2 && (year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
	{
		return 29;
	}
	return MonthDay[month];
}
Date& operator+=(int day);//日期与天数的加运算
Date operator+(int day);
private:
	int _year;
	int _month;
	int _day;
};



实现的逻辑也十分的简单,我们先来看看代码:

Date& Date::operator+=(int day)
{
	if (day < 0)
	{
		return (*this -= -day);
	}
	_day += day;
	while (_day > GetMonthDay(_year, _month))	
	{
		_day -= GetMonthDay(_year, _month);
		_month++;
		if (_month >= 13)
		{
			_year++;
			_month = 1;
		}
	}
	return *this;
}
Date Date::operator+(int day)
{
	Date tmp = *this;
	tmp += day;
	return tmp;
}

接下来我们来看看效果

 

接下来,我们使用网上的日期运算器来验证一下答案是否正确:

 

 5.日期-=和 -操作(日期减天数)的实现

日期与天数的想减得到日期的算法和前面的相加算法也相似。

我们还是先来定义相减运算:
 

#pragma once
#include<iostream>
#include<assert.h>
class Date
{
public:
	Date(int year = 2024, int month = 8, int day = 16);
	//~Date();
    void DatePeint();//日期打印
//比较大小运算符的重载
bool operator==(Date& d);
bool operator!=(Date& d);
bool operator>(Date& d);
bool operator<(Date& d);
bool operator<=(Date& d);
bool operator>=(Date& d);
//获取每个月的天数
int GetMonthDay(int year, int month)
{
	assert(month >= 1 && month <= 12);
	//因为这个数组会高频·的进行调用,所以使用静态数组就能极大地提高效率
	static int MonthDay[13] = { -1, 31,28, 31 ,30, 31,30, 31, 31, 30, 31, 30, 31 };
	//借用短路效应,适当的提高效率
	if ( month == 2 && (year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
	{
		return 29;
	}
	return MonthDay[month];
}
Date& operator+=(int day);//日期与天数的加运算
Date operator+(int day);
Date& operator+=(int day);//日期与天数的减运算
Date operator+(int day);
private:
	int _year;
	int _month;
	int _day;
};



减运算符重载的实现与加运算符的实现逻辑基本相同,我们直接看代码:
 


Date& Date::operator-=(int day)
{
	if (day < 0)
	{
		return (*this += -day);
	}
	_day -= day;
	while (_day <= 0)
	{
		_day += GetMonthDay(_year, _month);
		_month--;
		while (_month <= 0)
		{
			_year--;
			_month = 12;
		}
	}
	return *this;
}
Date Date::operator-(int day)
{
	Date tmp = *this;
	tmp -= day;
	return tmp;
}

接下来我们来测试一下运行效果:

让我们用日期计算器来验算一下日期的计算结果是否正确:

 

6. 前置++(--)与后置++(--)

根据我们前面的基础知识,我们知道前置++(--)和后置++(--)的冲在式定义就是根据是否有参数来判断的,所以本质上他们的实现就与+=(-=)和-=(-) 相似。

首先来看定义:

#pragma once
#include<iostream>
#include<assert.h>
class Date
{
public:
	Date(int year = 2024, int month = 8, int day = 16);
	//~Date();
    void DatePeint();//日期打印
//比较大小运算符的重载
bool operator==(Date& d);
bool operator!=(Date& d);
bool operator>(Date& d);
bool operator<(Date& d);
bool operator<=(Date& d);
bool operator>=(Date& d);
//获取每个月的天数
int GetMonthDay(int year, int month)
{
	assert(month >= 1 && month <= 12);
	//因为这个数组会高频·的进行调用,所以使用静态数组就能极大地提高效率
	static int MonthDay[13] = { -1, 31,28, 31 ,30, 31,30, 31, 31, 30, 31, 30, 31 };
	//借用短路效应,适当的提高效率
	if ( month == 2 && (year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
	{
		return 29;
	}
	return MonthDay[month];
}
Date& operator+=(int day);//日期与天数的加运算
Date operator+(int day);
Date& operator-=(int day);//日期与天数的减运算
Date operator-(int day);

//前置和后置的区别就是看式子中是不是有参数
Date& operator++();
Date& operator++(int );
Date& operator--();
Date& operator--(int);
private:
	int _year;
	int _month;
	int _day;
};



我们直接来代码:

Date& Date::operator++()
{
	return (*this += 1);
}
Date& Date::operator++(int)
{
	Date tmp(*this);
	*this += 1;
	return tmp;
}

Date& Date:: operator--()
{
	return (*this -= 1);
}
Date& Date::operator--(int)
{
	Date tmp(*this);
	*this -= 1;
	return tmp;
}

简单的来看看效果,单独看这个的用处好像是不大,但是结合到接下来我们要实现的功能,这个重载式就会发挥很大的作用:

7.两日期之间相差的天数 

 首先我们还是先来定义这个重载式:

#pragma once
#include<iostream>
#include<assert.h>
class Date
{
public:
	Date(int year = 2024, int month = 8, int day = 16);
	//~Date();
    void DatePeint();//日期打印
//比较大小运算符的重载
bool operator==(Date& d);
bool operator!=(Date& d);
bool operator>(Date& d);
bool operator<(Date& d);
bool operator<=(Date& d);
bool operator>=(Date& d);
//获取每个月的天数
int GetMonthDay(int year, int month)
{
	assert(month >= 1 && month <= 12);
	//因为这个数组会高频·的进行调用,所以使用静态数组就能极大地提高效率
	static int MonthDay[13] = { -1, 31,28, 31 ,30, 31,30, 31, 31, 30, 31, 30, 31 };
	//借用短路效应,适当的提高效率
	if ( month == 2 && (year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
	{
		return 29;
	}
	return MonthDay[month];
}
Date& operator+=(int day);//日期与天数的加运算
Date operator+(int day);
Date& operator-=(int day);//日期与天数的减运算
Date operator-(int day);

//前置和后置的区别就是看式子中是不是有参数
Date& operator++();
Date& operator++(int );
Date& operator--();
Date& operator--(int);

//计算两个日期之间的天数差
int operator-(const Date&  d);
private:
	int _year;
	int _month;
	int _day;
};



大家在这个时候可以来想想,用什么方法能得到两个日期之间的天数差异:

想要实现这个方法其实十分的简单,我们先找到小的那个日期,再让这个日期++,记录他++的次数,直到他与那个较大的日期相等为止,记录得到的次数就是相差的天数。

接下来我们来实现一下代码:

int Date::operator-(const Date& d)
{
	Date small =d ;
	Date big = *this;
	int flag = 1;
	if (big < small)
	{
		big = d;
		small = *this;
		flag *= -1;
	}
	int count = 0;
	while (small < big)
	{
		small++;
		++count;
	}
	return (count - 1) * flag;
}

 我们实现了代码,接下来我们来测试一下代码的效果:

我们就简单测试一下从 8 月16号,到今年国庆节之间的天数差,然后我们就在网上的日期计算器上验算一下我们得结果:

8.代码展示

我们完成了日期计算器的, 接下来是代码展示:

Date.h

#pragma once

#include<iostream>
#include<assert.h>
using namespace std;
class Date
{
public:
	friend ostream& operator<<(ostream& out, const Date& d);
	friend istream& operator>>(istream& out,  Date& d);
	Date(int year  = 2024, int month  = 8, int day = 16);
	///~Date();
	//日期值的打印
	void DatePrint();

	//赋值运算符的重载
	Date& operator=(const Date& d1);
	//比较大小运算符的重载
	bool operator==(Date& d);
	bool operator!=(Date& d);
	bool operator>(Date& d);
	bool operator<(Date& d);
	bool operator<=(Date& d);
	bool operator>=(Date& d);
	//获取每个月的天数
	int GetMonthDay(int year, int month)
	{
		assert(month >= 1 && month <= 12);
		//因为这个数组会高频·的进行调用,所以使用静态数组就能极大地提高效率
		static int MonthDay[13] = { -1, 31,28, 31 ,30, 31,30, 31, 31, 30, 31, 30, 31 };
		//借用短路效应,适当的提高效率
		if ( month == 2 && (year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
		{
			return 29;
		}
		return MonthDay[month];
	}
	Date& operator+=(int day);
	Date operator+(int day);
	Date& operator-=(int day);
	Date operator-(int day);

	//前置++
	Date& operator++();
	Date& operator++(int );
	Date& operator--();
	Date& operator--(int);

	//计算两个日期之间的天数差
	int operator-(const Date&  d);

	bool CheckDate()
	{
		
		if (_month >= 13 || _month <= 0)
		{
			return false;
		}
		if (_day >= GetMonthDay(_year, _month)	|| _day <= 0)
		{
			return false;
		}
		return true;
	}
private:
	int _year;
	int _month;
	int _day;
};

//ostream& operator<<(ostream& out, const Date& d); 
//& operator>>(istream& out, const Date& d);

Date.cpp 

#define _CRT_SECURE_NO_WARNINGS 1

#include"Date.h"
Date::Date(int year, int month, int day)
{
	_year = year;
	_month = month;
	_day = day;
	if (!CheckDate())
	{
		cout << "输入非法日期!!" << "->";
		cout << *this;
	}
}

void Date::DatePrint()
{
	cout << _year << "/" << _month << "/" << _day << endl;
}
bool Date::operator==(Date& d)
{
	return _year == d._day 
		&& _month == d._month
		&& _day == d._day;
}
Date& Date::operator=(const Date& d1)
{
	
		_year = d1._year;
		_month = d1._month;
		_day = d1._day;

	return *this;

}

bool Date::operator!=(Date& d)
{
	return !(*this == d);
}
bool Date::operator>(Date& d)
{
	if (_year > d._year )
	{
		return true;
	}
	else if (_year == d._year && _month >d._month)
	{
		return true;
	}
	else if (_year == d._year && _month == d._month && _day > d._day)
	{
		return true;
	}
	return false;
}
bool Date::operator<(Date& d)
{
	return !(*this >= d);
}
bool Date::operator<=(Date& d)
{
	return *this < d || *this == d;
}
bool Date::operator>=(Date& d)
{
	return *this > d || *this == d;
}
Date& Date::operator+=(int day)
{
	if (day < 0)
	{
		return (*this -= -day);
	}
	_day += day;
	while (_day > GetMonthDay(_year, _month))	
	{
		_day -= GetMonthDay(_year, _month);
		_month++;
		if (_month >= 13)
		{
			_year++;
			_month = 1;
		}
	}
	return *this;
}
Date Date::operator+(int day)
{
	Date tmp = *this;
	tmp += day;
	return tmp;
}
Date& Date::operator-=(int day)
{
	if (day < 0)
	{
		return (*this += -day);
	}
	_day -= day;
	while (_day <= 0)
	{
		_day += GetMonthDay(_year, _month);
		_month--;
		while (_month <= 0)
		{
			_year--;
			_month = 12;
		}
	}
	return *this;
}
Date Date::operator-(int day)
{
	Date tmp = *this;
	tmp -= day;
	return tmp;
}
Date& Date::operator++()
{
	return (*this += 1);
}
Date& Date::operator++(int)
{
	Date tmp(*this);
	*this += 1;
	return tmp;
}

Date& Date:: operator--()
{
	return (*this -= 1);
}
Date& Date::operator--(int)
{
	Date tmp(*this);
	*this -= 1;
	return tmp;
}

int Date::operator-(const Date& d)
{
	Date small =d ;
	Date big = *this;
	int flag = 1;
	if (big < small)
	{
		big = d;
		small = *this;
		flag *= -1;
	}
	int count = 0;
	while (small < big)
	{
		small++;
		++count;
	}
	return (count - 1) * flag;
}
ostream& operator<<(ostream& out, const Date& d)
{
	out << d._year << "年" << d._month << "月" << d._day << "日" << endl;
	return out;
}

istream& operator>>(istream& in, Date& d)
{
	cout << "请依次输入有效的年月日信息" << endl;
	while (1)
	{
		in >> d._year >> d._month >> d._day;
		if (d.CheckDate())
		{
			break;
		}
		cout << "日期非法!!" << "->";
		cout << d;
	}
	return in;
}

Test.c 

#define _CRT_SECURE_NO_WARNINGS 1

#include"Date.h"


int  main()
{
	Date d1;
	Date d2(2024, 10, 1);
	d1.DatePrint();
	d2.DatePrint();
	cout << d2 - d1 << endl;
}

 好,今天的学习就到这里了,我们下期再见,拜拜!!!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2052609.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

C++入门基础知识21

成长路上不孤单&#x1f60a;【14后小学生一枚&#xff0c;C爱好者&#xff0c;持续分享所学&#xff0c;如有需要欢迎收藏转发&#x1f60a;&#x1f60a;&#x1f60a;&#x1f60a;&#x1f60a;&#x1f60a;&#x1f60a;】 关于【C 数据类型】 【&#xff01;&#xff…

工业超高频读写器在工业领域的实际应用

工业级超高频读写器在多个领域具有广泛的应用&#xff0c;主要得益于其远距离读取、群读、穿透识别以及高数据传输速率等特性。以下是对其应用的具体分析&#xff1a; 一、物流仓储 货物追踪与管理&#xff1a;在物流仓储领域&#xff0c;工业级超高频读写器能够识别并跟踪货…

Python FlashText库:高效的关键词搜索和替换

更多Python学习内容&#xff1a;ipengtao.com 在文本处理中&#xff0c;关键词搜索和替换是常见且重要的任务。传统的正则表达式在处理大量文本时可能效率不高&#xff0c;而Python的FlashText库提供了一种高效的关键词搜索和替换方法&#xff0c;尤其适合处理海量数据。本文将…

746. 使用最小花费爬楼梯-dp3

. - 力扣&#xff08;LeetCode&#xff09;. - 备战技术面试&#xff1f;力扣提供海量技术面试资源&#xff0c;帮助你高效提升编程技能,轻松拿下世界 IT 名企 Dream Offer。https://leetcode.cn/problems/min-cost-climbing-stairs/description/从左向右填dp表 class Solutio…

机器学习带来的新见解挑战星系形成理论

最近的研究发现&#xff0c;处于高密度环境中的星系往往比孤立的星系大得多&#xff0c;这对现有的星系形成理论提出了挑战。这一发现得益于机器学习和来自数百万个星系的大量数据。这些发现提出了关于暗物质和星系合并在塑造宇宙中的作用的新问题。 密集环境中的星系与孤立环境…

C语言—指针(1)

目录 一、内存和地址 &#xff08;1.1&#xff09;内存 &#xff08;1.2&#xff09;编址的理解 二、指针变量和地址 &#xff08;2.1&#xff09;取地址操作符&#xff08;&&#xff09; &#xff08;2.2&#xff09;指针变量和解引用操作符 &#xff08;2.2.1&…

特征融合篇 | YOLOv10 应用轻量级通用上采样算子CARAFE | 《特征的内容感知重组》

特征上采样是现代卷积神经网络架构中的关键操作,例如特征金字塔。其设计对于密集预测任务,如目标检测和语义/实例分割至关重要。在本研究中,我们提出了一种称为内容感知特征重组(CARAFE)的通用、轻量级且高效的操作符,以实现这一目标。CARAFE具有以下几个优点:(1)大的…

【附源码】Python :正方体建模

系列文章目录 Python 建模入门&#xff1a;正方体建模 文章目录 系列文章目录一、建模需求二、源代码三、代码分析四、效果展示总结 一、建模需求 使用matplotlib库和mpl_toolkits.mplot3d模块来绘制一个立方体的3D图形 二、源代码 代码如下&#xff1a; import matplotlib.p…

从0-1开发一个Vue3前端系统页面-10.导航栏菜单选中问题

注意&#xff1a;本项目已将前端源码同步上传至Gitee&#xff0c;项目已开源&#xff0c;仅供参考&#xff0c;不涉及商用&#xff0c;著作权归本人所有。 开源项目链接&#xff1a;Wandering-children-have-the-stars-as-companions: WCHTSAC (gitee.com)https://gitee.com/C…

TCP通信,HTTP协议

TCP通信 1.流式套接字与数据报套接字的区别: 1.数据报套接字:每一包数据传输的目的可能不同&#xff0c;所以每一包需要单独处理(MTU:1500) 2.流式套接字:数据以流的形式连续的传输&#xff0c;有可能产生数据粘连&#xff0c;解决方式(固定长度、数据包间设定间隔 2.TCP包头…

内网安全:跨域攻击

目录 获取域信息 利用域信任密钥获取目标域 利用krbtgt哈希值获取目标域 内网中的域林&#xff1a; 很多大型企业都拥有自己的内网&#xff0c;一般通过域林进行共享资源。根据不同职能区分的部门&#xff0c;从逻辑上以 主域和子域进行区分&#xff0c;以方便统一管理。在…

C++学习笔记----3、设计专业的C++程序(八)---- 设计国际象棋程序

今天我们就来介绍一个系统性的方法去设计一个C程序&#xff0c;一个简单的国际象棋程序。为了提供完整的案例&#xff0c;有些步骤的概念目前还没有讲到。现在学习该案例来获得一一些人设计过程的整体印象&#xff0c;当你学习了那些概念后也可以再回头重新阅读本篇。 1、需求…

《黑神话》主线时长约40小时 100%完成需90小时

《黑神话&#xff1a;悟空》即将正式发售&#xff0c;媒体评分也已解禁&#xff0c;M站均分为82分。在游戏发售之前&#xff0c;许多粉丝仍想了解关于该作的更多信息。游戏科学未确定《黑神话》游戏时长是多久&#xff0c;幸运的是有评测员透露其主线时长约为40小时&#xff0c…

亲测好用,吐血整理 ChatGPT 3.5/4.0 新手使用手册~ 【2024.08 更新】

废话不多说&#xff0c;直接分享正文~ 以下是小编为大家搜集到的最新的ChatGPT国内站&#xff0c;各有优缺点。 1、AI Plus&#xff08;稳定使用&#xff09; 推荐指数&#xff1a;⭐⭐⭐⭐⭐ yixiaai.com 该网站已经稳定运营了1年多了。2023年3月份第一批上线的网…

如何在Python中正确使用浅拷贝和深拷贝?

更多资料获取 &#x1f4da; 个人网站&#xff1a;ipengtao.com 在Python编程中&#xff0c;拷贝对象是一个常见的操作&#xff0c;尤其是在处理复杂数据结构时。Python提供了两种拷贝方式&#xff1a;浅拷贝&#xff08;shallow copy&#xff09;和深拷贝&#xff08;deep co…

day35-四层负载

01.四层负载概念 02.四层实现对端口转发 1.克隆一台10.0.0.4 2.安装部署nginx服务 [rootlb:~]# scp 10.0.0.7:/etc/yum.repos.d/nginx.repo /etc/yum.repos.d/[rootlb:~]#yum -y install nginx3.配置nginx四层负载 [rootlb:~]#rm -rf /etc/nginx/conf.d/default.conf # 删除默认…

【重磅发布】2025华清远见新品发布会亮点、新品抢先看!

匠心服务 智启新程 大咖云集 • 行业分析 • 预见趋势 新品首发 • 课程升级 • 育人交流 - 2025华清远见新品发布会 将于2024年8月23日在北京隆重举行 诚邀您的到来&#xff01; 大会背景 本次新品发布会以 “匠心服务 智启新程”为主题&#xff0c; 邀请多家业内知名…

顶刊中的水刊!中科院1区TOP和“平替”双打组合,3天初审,25天可录用!

高分“水刊” 前面小编解析了一本MDPI旗下能源电力类期刊《Energies》 &#xff08;&#x1f449;详情参考&#xff1a;MDPI旗下Energies“平替”&#xff1a;这本SCI又“水”又稳&#xff0c;不卡背景&#xff0c;25天录用吊打同行&#xff09; 本期解析一本顶刊&#xff0c…

【Python零基础学习】字典

文章目录 前言一、简单字典示例二、使用字典三、字典遍历四、嵌套总结 前言 Python 字典 是一种非常强大且灵活的数据结构&#xff0c;它允许你通过键&#xff08;key&#xff09;来存储和检索值&#xff08;value&#xff09;。想象一下&#xff0c;字典就像一个巨大的电话簿…

免费分享一套SpringBoot+Vue员工管理(职工管理,考勤管理,奖惩管理,合同管理)管理系统【论文+源码+SQL脚本】,帅呆了~~

大家好&#xff0c;我是java1234_小锋老师&#xff0c;看到一个不错的SpringBootVue员工管理(职工管理&#xff0c;考勤管理&#xff0c;奖惩管理&#xff0c;合同管理)管理系统&#xff0c;分享下哈。 项目视频演示 【免费】SpringBootVue员工管理(职工管理&#xff0c;考勤…