51:知识点:综合利用了之前的string的各项额外操作
#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<vector>
#include<forward_list>
using namespace std;
class Date
{
public://class默认是私有继承,记得要加public
unsigned _year;
unsigned _month;
unsigned _day;
void _show()
{
cout<<_year<<"年"<<_month<<"月"<<_day<<"日"<<endl;
}
//构造函数
Date(string);
};
Date::Date(string s)
{
int flag = 0;
string number = "0123456789/";
string coma = ",";
string month;
unsigned pos,pos1,pos2,pos3;
unsigned _pos,_pos1;
/

本文提供了C++Primer第五版第九章中关于栈适配器(stack)的习题解答,重点讲解了stack的pop()、push()和top()操作,以及其与queue和priority_queue的区别,强调了先进后出(LIFO)的原则。
订阅专栏 解锁全文
33万+

被折叠的 条评论
为什么被折叠?



