![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
牛客网
Eric_Tseng
https://github.com/Questzzq
展开
-
C++ 知识点整理
1. static关键字①:全局静态变量全局变量前加上关键字 static,全局变量就定义成一个全局静态变量。全局静态变量存在于静态存储区,在整个程序运行期间一直存在。未经初始化的全局静态变量会被自动初始化为 0。全局静态变量在声明他的文件之外是不可见的,准确地说是从定义之处开始,到文件结尾。②:局部静态变量在局部变量之前加上关键字 static,局部变量就成为一个局部静态变量。...原创 2020-02-27 12:23:28 · 193 阅读 · 0 评论 -
C++ 使用 cin 和 cout 解决进制转换
默认状态下,数据按 10 进制输入输出但是 oct 和 hex 和 dec 可以指定以八进制, 十六进制, 或者十进制输入输出#include <iostream>using namespace std;int main(){ int x; while(cin >> hex >>x) { cout << d...原创 2020-02-12 23:21:55 · 456 阅读 · 0 评论 -
查找兄弟单词
题目链接#include <iostream>#include <algorithm>#include <vector>using namespace std;bool isBrother(string a, string b) { if((a == b) || (a.size() != b.size())) retur...原创 2020-02-09 02:09:05 · 131 阅读 · 0 评论 -
字串的连接最长路径查找
题目链接#include <iostream>#include <vector>#include <algorithm>using namespace std;int main() { int n; while(cin >> n) { string tmp; vector<string> s; ...原创 2020-01-29 22:25:34 · 143 阅读 · 0 评论 -
求int型正整数在内存中存储时1的个数
题目链接#include <iostream>using namespace std;int main() { int n; int sum; while(cin >> n) { sum = 0; while(n != 0) { if(n % 2 == 1) sum++; n = n&g...原创 2020-01-29 22:22:35 · 139 阅读 · 0 评论 -
密码验证合格程序
题目链接#include <iostream>#include <cstring>using namespace std;bool isThree(string s) { int ans[4] = {0, 0, 0, 0}; for(int i = 0; i < s.length(); i++) { if(s[i] >=...原创 2020-01-29 22:17:16 · 130 阅读 · 0 评论