c++编程基础
文章平均质量分 68
trainhui
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
c++中浅构造和深构造
我的理解浅构造就是简单的赋值运算,深构造就是涉及到引用,指针之类的。 先说说浅构造(没有指针): #include<iostream> #include<string> using namespace std; class example { public: example(int Num) : mNum(Num){ }; ~example(); voi...原创 2019-01-24 17:25:00 · 844 阅读 · 0 评论 -
如何用c++来写一个九九乘法表
九九乘法表的原理是第一个for循环是控制行数,第二个for循环是控制每行的数据的相乘,例如,i=3时进入第一个for循环,3是小于等于9的,进入第二个for循环,就j=1,t=1*3,j=2,t=2*3,j=3,t=3*3,以此类推。 #if 1 #include<iostream> using namespace std; int main() { int i,j,t; ...原创 2018-07-26 22:59:51 · 32864 阅读 · 0 评论 -
简单的字符反转
例子:cuishenghui 反转后:iuhgnehsiuc #include <iostream> #include<string> using namespace std; void reverse_myString(char* str) { char*p = str; int i = 0; while (*p!= '\0')//要加*没有加*的话就读不出‘...原创 2019-02-21 15:35:16 · 224 阅读 · 0 评论 -
深度搜索。
将1,2,3张排放在3个箱子内,有哪几种排法??? #include<iostream> using namespace std; int arr[4], book[3]; void test01(int step) { if (step == 4)//箱子已经满了,没有牌可以放了 { for (int i = 1; i <=3; i++) { cout &...原创 2019-01-30 12:28:39 · 1567 阅读 · 0 评论
分享