C++ Tree类
来源:互联网 发布:ug编程基础 编辑:程序博客网 时间:2024/04/27 13:52
#include<iostream>using namespace std;class Tree{public: Tree(int ages){ _ages = ages; } ~Tree(); void grow(int years){ _ages += years; } void age();private: int _ages;};void Tree::age(){ cout << "这棵树的年龄是:" << _ages << endl;}int main(){ int treeage; Tree thetree(7); thetree.age(); thetree.grow(100); thetree.age(); cout << "请输入成长又经历的时间:"; cin >> treeage; Tree smalltree(treeage); smalltree.age(); smalltree.grow(treeage); smalltree.age(); return 0;}
0 0
- C tree
- c tree
- tree.c
- kd-tree算法(C)
- leetcode: Same Tree (C++)
- C - Spanning Tree
- Binary Tree(C++)
- #LeetCode# #C++# Symmetric Tree
- C. k-Tree
- leetcode_100_Same Tree (C++)(easy)
- c tree childlik
- C++/MFC-Tree Control
- [C++] [算法] [Linux] radix tree
- 【C++】1020. Tree Traversals (25)
- CF 109C: Lucky Tree
- Codefoces 431 C. k-Tree
- kd-tree c语言代码
- c语言实现tree数据结构
- [编程题]Be Unique (赌徒下注问题)
- PronunciationState API
- numpy解方程
- 黑马程序员-Java基础-面向对象
- 第一个mybatis例子
- C++ Tree类
- SentenceHMMStateArc API
- uboot想Linux内核传递参数
- ORACLE数据库查看执行计划的方法
- hybris5.2学习-----Trail ~ Preparation
- SentenceHMMStateVisitor API
- 光标
- 【Oracle篇】Oracle初试水
- SentenceHMMState api