![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Q
Winner_w
态度决定一切
展开
-
Q1:手撕String类
#include <iostream>#include <string>using namespace std;class MyString{public: MyString(const char* str=NULL); MyString(const MyString& string); MyString& operator=(const...原创 2019-08-08 23:08:41 · 394 阅读 · 0 评论 -
笔试:如何实现输入一行数据,且数据间通过空格分隔
因为最近在做笔试题多次遇到类似题目这样的输入要求所以决定写一篇文章记录一下我的一个小收获,这些算法题都是这样的:第一行输入数字,且按空格分割开,第二行巴拉巴拉。这种题共两种:1.字符串2.数字1.字符串:我实现是通过string 实现的,毕竟方便简单。string str;getline(cin,str);printf(str.c_str());这里我用的是...原创 2019-08-23 22:44:55 · 3294 阅读 · 0 评论