摘要:        
C++11引入了auto和decltype关键字 使用他们可以在编译期就推导出变量或者表达式的类型,方便开发者编码也简化了代码。 auto示例 auto a = 10; // 10是int型,可以自动推导出a是int int i = 10; auto b = i; // b是int型 auto d     阅读全文
posted @ 2022-11-08 20:43
slowlydance2me
阅读(81)
评论(0)
推荐(0)
        
            
        
        
摘要:        
K means教程 0.引入依赖 import numpy as np import matplotlib.pyplot as plt # 引入数据 from sklearn.datasets import make_blobs 1.数据加载 x, y = make_blobs( n_samples    阅读全文
posted @ 2022-11-08 17:30
slowlydance2me
阅读(29)
评论(0)
推荐(0)
        
            
        
        
摘要:        
语法错误: 或者逗号打成顿号    阅读全文
posted @ 2022-11-08 17:06
slowlydance2me
阅读(46)
评论(0)
推荐(0)
        
            
        
        
摘要:        
    阅读全文
posted @ 2022-11-08 17:04
slowlydance2me
阅读(18)
评论(0)
推荐(0)
        
            
        
        
摘要:        
    阅读全文
posted @ 2022-11-08 16:25
slowlydance2me
阅读(151)
评论(0)
推荐(0)
        
            
        
        
摘要:        
原因: 在C++中, 由于以下原因, 变量通过引用传递: 1)要修改调用者函数的局部变量:引用(或指针)允许被调用函数修改调用者函数的局部变量。例如, 考虑以下示例程序, 其中fun()能够修改局部变量Xof主要(). 2)对于传递大型参数:如果实参很大,通过引用(或指针)传递更有效,因为实际上只传    阅读全文
posted @ 2022-11-08 15:29
slowlydance2me
阅读(287)
评论(0)
推荐(0)
        
            
        
        
摘要:        
sizeof(a)返回的是对象占用内存的字节数,而a.size()是string类定义的一个返回字符串大小的函数,两个是完全不一样的概念。 明确两者的概念和作用: 1、size()函数: c++中,在获取字符串长度时,size()函数与length()函数作用相同。 除此之外,size()函数还可以    阅读全文
posted @ 2022-11-08 15:08
slowlydance2me
阅读(799)
评论(0)
推荐(0)
        
            
        
        
摘要:        
给你一个由不同字符组成的字符串 allowed 和一个字符串数组 words 。如果一个字符串的每一个字符都在 allowed 中,就称这个字符串是 一致字符串 。 请你返回 words 数组中 一致字符串 的数目。 示例 1: 输入:allowed = "ab", words = ["ad","b    阅读全文
posted @ 2022-11-08 15:08
slowlydance2me
阅读(40)
评论(0)
推荐(0)
        
            
        
        
摘要:        
类型转换String 写入/追加文件 正则表达式字符 yield关键字    阅读全文
posted @ 2022-11-08 10:24
slowlydance2me
阅读(14)
评论(0)
推荐(0)
        

 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号