摘要: #include<stdio.h>struct name{ char *name; char n; int age; char *sex; char *ss;}stduent;int main(){ stduent.age=10; stduent.name="弘一"; stduent.sex="男" 阅读全文
posted @ 2022-03-10 08:48 眰恦01 阅读(52) 评论(0) 推荐(0)
摘要: #include<iostream>#include<string>class Lkuy{ public: Lkuy(std::string name,int a){ this->a=a; this->name=name; } virtual void print();//虚函数(动态绑定); in 阅读全文
posted @ 2022-03-08 22:13 眰恦01 阅读(57) 评论(0) 推荐(0)
摘要: C++中的多态是通过虚函数来实现的。 只有通过积累的指针或引用来调用虚函数,才会对被调用的函数进行动态绑定。 阅读全文
posted @ 2022-03-07 12:30 眰恦01 阅读(32) 评论(0) 推荐(0)
摘要: #include<iostream>#include<string>class Time{ public: void kiss(Time *m); Time(std::string name,int a,int b){ this->name=name; this->a=a; this->b=b; } 阅读全文
posted @ 2022-03-03 23:00 眰恦01 阅读(77) 评论(0) 推荐(0)
摘要: #include<iostream>int main(){ int i; int j; int a[][3]={{1},{2}}; for(int i=0;i<=2;i++){ for(int j=0;j<=2;j++){ std::cout<<a[i][j]; } std::cout<<"\n"; 阅读全文
posted @ 2022-03-01 12:00 眰恦01 阅读(40) 评论(0) 推荐(0)
摘要: #include<iostream>#include<string>class Lovers{ public: Lovers(std::string name){ this->name=name; } void kiss(Lovers*lovers); void ask(Lovers *lovers 阅读全文
posted @ 2022-02-20 13:16 眰恦01 阅读(61) 评论(0) 推荐(0)
摘要: # include<iostream>#include<string>using namespace std;class Ba{ public: Ba(int a,int b){ this->a=a; this->b=b; } int show(); protected: int a; int b; 阅读全文
posted @ 2022-02-20 11:13 眰恦01 阅读(48) 评论(0) 推荐(0)
摘要: #include<iostream>using namespace std;class Time { public : show(double a, double b, double c) { this->a = a; this->b = b; this->c = c; } double show0 阅读全文
posted @ 2022-02-19 13:39 眰恦01 阅读(46) 评论(0) 推荐(0)
摘要: #include<iostream>using namespace std;class Tm{ public: int show01(); void show(){ cout<<"my name is xietingming!"<<endl; } Tmd(int a,int b,int c){ th 阅读全文
posted @ 2022-02-16 23:21 眰恦01 阅读(52) 评论(0) 推荐(0)
摘要: package kz; class MoPai { private int[] a; private int n; public MoPai(int[] a) { this.a = a; this.n = a.length; } public void display() { for (int x 阅读全文
posted @ 2021-12-27 20:18 眰恦01 阅读(59) 评论(0) 推荐(0)