首页 > 其他分享 >5.13

5.13

时间:2023-05-13 23:44:23浏览次数:43  
标签:int tree ages years 5.13 Tree

#include <iostream>

using namespace std;

class Tree {

private:

    int ages;

public:

    Tree(int ages=0):

        ages(ages){}

    void grow(int years) {

        ages += years;

    }

    int getAges()const {

        return ages;

    }

 

};

int main() {

    Tree tree(10);

    tree.grow(5);

    cout << "The ages of the tree is:" << tree.getAges() << endl;

}

 

标签:int,tree,ages,years,5.13,Tree
From: https://www.cnblogs.com/lml66/p/17398522.html

相关文章

  • 编程一小时2023.5.13
    1.#include<bits/stdc++.h>usingnamespacestd;intn,x,ans=0,sum=0,a[1001],b[1001];intmain(){memset(a,0,sizeof(a));memset(b,0,sizeof(b));n=10;for(inti=1;i<=n;i++){cin>>x;if(x%2!=0)a[++ans]=x;elseb[+......
  • 5.13
    #include<iostream>#include<string>usingnamespacestd;classDocument{public:   Document(){   }   Document(char*nm);   char*name;   voidPrintNameOf();};Document::Document(char*nm){   name=newchar[strlen(nm)+1];......
  • 每日总结 5.13
    今日主要进行代码优化处理。<divclass="bigcontent"><!--muted:视频内容静音--><%Stringadv="";Connectionc=Tool.getConnection();PreparedStatementpre=null;ResultSet......
  • 2023.5.13——软件工程日报
    所花时间(包括上课):6h代码量(行):0行博客量(篇):1篇今天,上午学习,下午学习。我了解到的知识点:1.了解了一些数据库的知识;2.了解了一些python的知识;3.了解了一些英语知识;5.了解了一些Javaweb的知识;4.了解了一些数学建模的知识;6.了解了一些计算机网络的知识;......
  • day72(2023.5.13)
    1.Servlet技术详解 2.创建第一个Servlet案例 3.Tomcat运行过程 4.Servlet的生命周期 5.Servlet处理请求的原理 6.Servlet的作用 7.在Idea中创建Web工程 在Idea创建Web工程添加servlet-api.jar 在Idea中配置To......
  • MyBatits遇到的几个错误(5.13)
    问题描述Cause:java.sql.SQLException:Theservertimezonevalue‘�й���׼ʱ��’isunrecognizedorrepresentsmorethanonetimezone.YoumustconfigureeithertheserverorJDBCdriver(viatheserverTimezoneconfigurationproperty)touseamorespecifctime......
  • 5.13打卡
     二、设计思路三、程序流程图四、代码实现#include<bits/stdc++.h>usingnamespacestd;voidprint(ints[]);intjudge(intc[]);intj=0;intmain(){intsweet[10]={10,2,8,22,16,4,10,6,14,20};inti,t[10],l;printf("child......
  • 安装vue脚手架@vue/cli 4.5.13(稳定版)
    若NPM下载过慢,请参考本处改换镜像源:Here首先新建一个vue测试项目,还记得以前自己是用vue-cli2.0的版本去构建的,毕竟里面有默认配置好的webpack配置,但现在很多小伙......
  • 第1节 2020.05.13 智能互联网之关键系统实践篇【一】
                                                   ......
  • ABP(v5.13 ),替换全局异常处理过滤器
    ASP.NETBoilerplate说明:目标框架是.NETStandard2.0,包版本5.13.0全局异常处理过滤有两个,AbpExceptionFilter,AbpExceptionPageFilter是在services.AddAbp()的时候注册的......