随笔分类 -  C/C++ 基础知识

摘要:转自:https://blog.csdn.net/fzk0813/article/details/88303902 阅读全文
posted @ 2020-03-31 21:42 Y鱼鱼鱼Y 阅读(446) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/ComputerG/archive/2012/02/01/2334898.html 感谢! 阅读全文
posted @ 2020-03-17 15:37 Y鱼鱼鱼Y 阅读(80) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main() { int n = 1; cout << "输入一个整数: "; cin >> n; if ( ( n & 1 ) == 0) cout << n << " 为偶数。"; else cout << 阅读全文
posted @ 2020-02-26 16:11 Y鱼鱼鱼Y 阅读(510) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/weixin_43828245/article/details/90180568 用法:getline(cin,str); // 前面的cin是固定的, 后面的str是变量名,必须是string类型的 阅读全文
posted @ 2020-02-18 15:48 Y鱼鱼鱼Y 阅读(757) 评论(0) 推荐(0) 编辑
摘要:整数类型 1.byte类型 分配1个字节内存,占8位(二进制),取值范围是-27~27-1 2.int类型 分配4个字节内存,占32位,取值范围: -232~232-1. (10^9数量级) 3.long long类型 分配8个字节内存,占64位,取值范围是: -264~264-1.(10^18数量 阅读全文
posted @ 2020-02-14 16:03 Y鱼鱼鱼Y 阅读(441) 评论(0) 推荐(0) 编辑
摘要:具体样例如下图:(重点记左移右移位运算符) 阅读全文
posted @ 2020-02-14 15:49 Y鱼鱼鱼Y 阅读(4627) 评论(0) 推荐(1) 编辑
摘要:百度百科: Int64是有符号 64 位整数数据类型,相当于C++中的long long、 C# 中的 long 和 SQL Server 中的 bigint,表示值介于 -2^63 ( -9,223,372,036,854,775,808) 到2^63-1(+9,223,372,036,854,7 阅读全文
posted @ 2020-02-12 22:51 Y鱼鱼鱼Y 阅读(960) 评论(0) 推荐(0) 编辑
摘要:在VC++6.0中原型为double pow( double x, double y );头文件:cmath功能:计算x的y次幂。返回值:x不能为负数且y为小数,或者x为0且y小于等于0,返回幂指数的结果。返回类型:double型,int,float会给与警告!举例: #include<math.h 阅读全文
posted @ 2020-02-08 20:56 Y鱼鱼鱼Y 阅读(2324) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/Hollay/article/details/96465133 阅读全文
posted @ 2020-02-08 12:13 Y鱼鱼鱼Y 阅读(493) 评论(0) 推荐(0) 编辑
摘要:c++内置二分查找 #include < algorithm > 一、binary_search:查找某个元素是否出现。函数模板:binary_search(arr[], arr[]+size, indx)1参数说明:arr[]: 数组首地址size:数组元素个数indx:需要查找的值函数功能: 在 阅读全文
posted @ 2019-12-17 19:28 Y鱼鱼鱼Y 阅读(860) 评论(0) 推荐(0) 编辑