
C++语言
文章平均质量分 95
大风起兮d
这个作者很懒,什么都没留下…
展开
-
使用Python训练好的决策树模型生成C++代码
在实际工程中,有时候我们使用python进行模型训练,但是训练好的模型需要写在芯片中,这个时候怎么弄呢?笔者在网上找了一下,没有发现可以将训练好的模型直接转化为我们需要的语言,比如C++。因此笔者自己动手写.原创 2022-04-01 18:41:50 · 4800 阅读 · 0 评论 -
C++使用下标,范围for和指针的二维数组的写法
#include <iterator> //这里使用了标准库的begin和endvoid twoDe() //P116->T3.43 范围for的二维数组{ int a[3][4] = { 1,2,3,4,5,6,7,8,9,4,5,32 }; size_t i = 0; for(auto &row:a) for (auto &col : ...原创 2018-04-27 09:24:22 · 1076 阅读 · 0 评论 -
c++中一次读入一整行和一个词,比较两个字符串的大小和长度
下面代码实现从标准输入中读入一整行,读入一个词 两个字符串的比较#include "stdafx.h"#include <iostream>#include <string>using std::cin;using std::cout;using std::endl;using std::string;void readOneLine();void...原创 2018-04-25 20:09:57 · 992 阅读 · 0 评论 -
将一串包含有标点的字符串去掉标点
ispunct()函数在cctype头文件中string delatePunct(string s) //P86->3.10 将一串包含有标点的字符串去掉标点{ string s1; for (auto c : s) if (!ispunct(c)) //ispunct(c)是检测c是否是标点 s1 += c; cout << s1 << end...原创 2018-04-25 22:27:08 · 1008 阅读 · 0 评论 -
读入一组整数和字符串存入vector对象中
#include <vector>using std::vectorvector<string> readText(){ string word; vector<string> text; while (cin >> word) text.push_back(word); for (auto i : text) cout <&...原创 2018-04-26 10:30:38 · 4584 阅读 · 0 评论