![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
编程题
daniel_is_me
这个作者很懒,什么都没留下…
展开
-
字符串转整数
#include<bits/stdc++.h>using namespace std;int my_atoi(const char* str){ bool sign = false; int total = 0, i = 0; if(str[0] == '-') { sign = true; i=1; } while(str[i]...原创 2021-08-26 11:46:56 · 52 阅读 · 0 评论 -
C++实现 [PAT B-1028]人口普查
#include<bits/stdc++.h>using namespace std;using gg=long long;typedef struct Person{ string name; gg y,m,d; Person(gg yy, gg mm, gg dd, string n = ""):y(yy), m(mm),d(dd),name(n){} bool operator<(const Person &am...原创 2021-08-26 11:46:00 · 141 阅读 · 0 评论 -
C++ 函数对象类
#include<bits/stdc++.h>using namespace std;class CAbs{ public: CAbs(int i = 0):m_i(i>0?i:-i){} int operator()(int i){return i>0?i:-i;} int print_m_i(){cout<<m_i<<"\n";} ...原创 2021-08-26 11:39:14 · 78 阅读 · 0 评论 -
C++实现 [PAT B1009]说反话
#include<bits/stdc++.h>using namespace std;int main(){ string str; vector<string> vec; getline(cin, str); auto iter = str.begin(); while(iter!=str.end()) { string::iterator te...原创 2021-08-26 11:35:36 · 146 阅读 · 0 评论