小工具知识网

当前位置: 首页 > 行业知识 > C++ //练习 9.19 重写上题的程序,用list替代deque。列出程序要做出哪些改变。

行业知识

C++ //练习 9.19 重写上题的程序,用list替代deque。列出程序要做出哪些改变。

2026-11-01 04:18:57 来源:互联网转载

C++ Primer(第5版) 练习 9.19

练习 9.19 重写上题的程序,用list替代deque。列出程序要做出哪些改变。

环境:Linux Ubuntu(云服务器)
工具:vim

��

代码块
//头文件需要调整为list,同时deque的位置都换为list/*************************************************************************> File Name: ex9.19.cpp> Author: > Mail: > Created Time: Mon 26 Feb 2024 08:38:42 PM CST ************************************************************************/#include#includeusing namespace std;int main(){    list str;    string word;    while(cin>>word){        str.push_back(word);        if(cin.get() == '\n'){            break;        }    }    list::iterator it;    for(it = str.begin(); it != str.end(); ++it){        cout

上一篇:电脑怎么自己搭服务器?

下一篇:怎么提高权重最有效?