摘要: #include<iostream> using namespace std; int main() { int x,y; cin>>x>>y; if (x < y) { int tmp = y; y = x; x = tmp; } for (int i = y; i >= 1; i-- ) { i 阅读全文
posted @ 2023-05-17 22:57 刘梦磊 阅读(19) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int main() { int a[5]; for(int i=0;i<5;i++) { cin>>a[i]; } return 0; } 6-4 #include<iostream> #define N 40 usi 阅读全文
posted @ 2023-05-16 23:44 刘梦磊 阅读(27) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; #include<cmath> #include"time_user.h" class point { private: int x, y, z; public: void set() { cin >> x >> y 阅读全文
posted @ 2023-05-15 22:58 刘梦磊 阅读(17) 评论(0) 推荐(0)
摘要: #include<iostream>#include<string>using namespace std;class Myprint {public: void operator()(string text) { cout << text << endl; }};void test1() { My 阅读全文
posted @ 2023-05-14 20:49 刘梦磊 阅读(37) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class Tree { private: int ages; public: Tree(int ages=0): ages(ages){} void grow(int years) { ages += years; 阅读全文
posted @ 2023-05-13 23:39 刘梦磊 阅读(27) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; #include<string> class mother { public: mother() { cout << "mother\n"; } }; class daughter : public mother { p 阅读全文
posted @ 2023-05-12 23:39 刘梦磊 阅读(14) 评论(0) 推荐(0)
摘要: #include<iostream>#include<string>using namespace std;class Person {public: Person operator+(Person& p) { Person p3; p3.a = this->a + p.a; p3.b = this 阅读全文
posted @ 2023-05-11 21:01 刘梦磊 阅读(57) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; int i = 1; void other() { static int a = 2; static int b; int c = 10; a += 2; i += 32; c += 5; cout << " OTHER 阅读全文
posted @ 2023-05-10 20:48 刘梦磊 阅读(52) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; class Time; class Date { public: Date(int, int, int); void display(Time&); private: int year, month, day; }; c 阅读全文
posted @ 2023-05-09 23:24 刘梦磊 阅读(79) 评论(0) 推荐(0)
摘要: #include<iostream> using namespace std; class Time { public: Time(); friend void display(); private: int hour, minu, sec; }; Time::Time() { hour = 11; 阅读全文
posted @ 2023-05-08 23:31 刘梦磊 阅读(70) 评论(0) 推荐(0)