网站首页 站内搜索

搜索结果

查询Tags标签: std,共有 1098条记录
  • C++分割字符串方法

    C++标准目前没有提供分割字符串的方法,但可以自己实现之。 测试代码如下: #include <vector> #include <string> #include <iostream>std::vector<std::string> Split(const std::string& str, const char* delim) {std::vector<std::st…

    2021/11/27 20:40:18 人评论 次浏览
  • C++分割字符串方法

    C++标准目前没有提供分割字符串的方法,但可以自己实现之。 测试代码如下: #include <vector> #include <string> #include <iostream>std::vector<std::string> Split(const std::string& str, const char* delim) {std::vector<std::st…

    2021/11/27 20:40:18 人评论 次浏览
  • 【转载】可调用对象包装器、绑定器

    【本文转自】: 作者: 苏丙榅 链接: https://subingwen.com/cpp/bind/ 来源: 爱编程的大丙 1. 可调用对象是一个函数指针int print(int a, double b) {std::cout << a << b << std::endl;return 0; } // 定义函数指针 int (*func)(int, double) = &…

    2021/11/27 6:12:02 人评论 次浏览
  • 【转载】可调用对象包装器、绑定器

    【本文转自】: 作者: 苏丙榅 链接: https://subingwen.com/cpp/bind/ 来源: 爱编程的大丙 1. 可调用对象是一个函数指针int print(int a, double b) {std::cout << a << b << std::endl;return 0; } // 定义函数指针 int (*func)(int, double) = &…

    2021/11/27 6:12:02 人评论 次浏览
  • C++的string类

    #include <iostream> #include <string>using namespace std;int main() {int n(20);cout << n << endl;string a = "dog";string b =a + ", cat";cout << b << endl;string c = a + "dog" + "c…

    2021/11/26 17:10:35 人评论 次浏览
  • C++的string类

    #include <iostream> #include <string>using namespace std;int main() {int n(20);cout << n << endl;string a = "dog";string b =a + ", cat";cout << b << endl;string c = a + "dog" + "c…

    2021/11/26 17:10:35 人评论 次浏览
  • c++继承

    1 #include <iostream>2 #include <typeinfo>3 4 // definitation of Graph5 class Graph6 {7 public:8 virtual void draw() { std::cout << "Graph::draw() : just as an interface\n"; }9 }; 10 11 12 // definition of Rectangle, d…

    2021/11/26 14:09:48 人评论 次浏览
  • c++继承

    1 #include <iostream>2 #include <typeinfo>3 4 // definitation of Graph5 class Graph6 {7 public:8 virtual void draw() { std::cout << "Graph::draw() : just as an interface\n"; }9 }; 10 11 12 // definition of Rectangle, d…

    2021/11/26 14:09:48 人评论 次浏览
  • 过河卒

    #include <bits/stdc++.h>using namespace std;int main(){ int ax,ay,bx,by; cin>>ax>>ay>>bx>>by; int arr[ax+5][ay+5]; ax += 2; ay += 2; bx += 2; by += 2; memset(arr,0,sizeof(arr)); for(int i=0;i<…

    2021/11/24 23:42:20 人评论 次浏览
  • 过河卒

    #include <bits/stdc++.h>using namespace std;int main(){ int ax,ay,bx,by; cin>>ax>>ay>>bx>>by; int arr[ax+5][ay+5]; ax += 2; ay += 2; bx += 2; by += 2; memset(arr,0,sizeof(arr)); for(int i=0;i<…

    2021/11/24 23:42:20 人评论 次浏览
  • c++11 初始化列表 std::initializer_list

    c++11 初始化列表 std::initializer_list#include <iostream> #include <vector> #include <map>// 使用 std::initializer_list<int> 来初始化任意长度的初始化列表 //stl中的容器是通过使用 std::initializer_list 完成的 class Foo { public:F…

    2021/11/24 9:39:46 人评论 次浏览
  • c++11 初始化列表 std::initializer_list

    c++11 初始化列表 std::initializer_list#include <iostream> #include <vector> #include <map>// 使用 std::initializer_list<int> 来初始化任意长度的初始化列表 //stl中的容器是通过使用 std::initializer_list 完成的 class Foo { public:F…

    2021/11/24 9:39:46 人评论 次浏览
  • Educational Codeforces Round 116

    A. AB Balance 分析:只要第一个和最后一个相同,均满足 #include "bits/stdc++.h" using namespace std; const int maxn=1000+1; string s[maxn]; int main() {//freopen("in.txt","r",stdin);int n;ios::sync_with_stdio(false);cin>…

    2021/11/23 6:10:48 人评论 次浏览
  • Educational Codeforces Round 116

    A. AB Balance 分析:只要第一个和最后一个相同,均满足 #include "bits/stdc++.h" using namespace std; const int maxn=1000+1; string s[maxn]; int main() {//freopen("in.txt","r",stdin);int n;ios::sync_with_stdio(false);cin>…

    2021/11/23 6:10:48 人评论 次浏览
  • C++11——多线程编程14 如何创建线程对象的向量?

    翻译来自:https://thispointer.com/c11-how-to-create-vector-of-thread-objects/ 让我们创建一个 std::thread 对象的向量,即// 创建一个线程向量 std::vector < std::thread > vecOfThreads;现在让我们创建一个 std::function<> 对象,我们将把它作为线程…

    2021/11/22 20:12:17 人评论 次浏览
扫一扫关注最新编程教程