C++
文章平均质量分 57
糯米粿条呀
想用代码表达自己
展开
-
1229C++中使用CString以及求绝对值的函数
1. 使用CString要加#include<atlstr.h>头文件2. 使用绝对值要添加头文件:#include <iomanip>#include<cmath>//C++求绝对值:如果是整形的,就是abs(),如果是浮点型的,是fabs() ...原创 2018-02-26 18:07:26 · 212 阅读 · 0 评论 -
1229处理既含有中文又含有英文字符的字符串的相关程序解决方法
#include "stdafx.h"#include <string>#include <iostream>using namespace std;int _tmain(int argc, _TCHAR* argv[]){ string s = "你好CSDN,我的"; string t; for(int i=0; i<s.length(); i+...原创 2018-02-26 18:07:59 · 225 阅读 · 0 评论 -
1229C++中wstring处理宽字符
#include <iostream>#include <string>using namespace std;#define tab "\t"int main(){ locale def; cout<<def.name()<<endl; locale current = cout.getloc(); c...原创 2018-02-26 18:08:32 · 638 阅读 · 0 评论 -
320二叉树笔记
二叉树作为树的一种,是一种重要的数据结构常见类型:创建一颗二叉树(先序,中序,后序)、遍历一颗二叉树(先序,中序,后序和层次遍历)、求二叉树中叶子节点的个数、求二叉树的高度、求二叉树中两个节点的最近公共祖先、打印和为某一值的全部路径、求某一节点是否在一个树中等等。 不妨先看一下几种常见的二叉树: 完全二叉树:若二叉树的高度是h,除第h层之外,其他(1~h-1)层的节点数都达到了最大个数,并且第h层...原创 2018-03-27 23:17:13 · 138 阅读 · 0 评论