05 2023 档案

摘要:Twistzz会怎么做:#include<iostream>#include<string>using namespace std;class Myprint {public: void operator()(string text) { cout << text << endl; }};void 阅读全文
posted @ 2023-05-25 23:15 刘梦磊 阅读(9) 评论(0) 推荐(0) 编辑
摘要:} } return count; } int main() { string sentence; cout<<"请输入一条英文语句:"; getline(cin,sentence); int letter_count = count_letters(sentence); cout<<"这条英文中字 阅读全文
posted @ 2023-05-23 23:29 刘梦磊 阅读(24) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; void transpose(int mat[][3]) { int temp; for(int i=0;i<3;i++) { for(int j=i+1;j<3;j++) { temp=mat[i][j]; mat[i 阅读全文
posted @ 2023-05-22 23:24 刘梦磊 阅读(27) 评论(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-20 23:59 刘梦磊 阅读(12) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; int main() { int a; int *p; int r=a; *p=10; r=5; return 0; } 阅读全文
posted @ 2023-05-19 23:24 刘梦磊 阅读(44) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; int main() { double a; double *p=&a; cout<<"指针占了"<<sizeof(double) <<"字节"<<endl; cout<<"指针所指向的变量占了"<<sizeof(p) 阅读全文
posted @ 2023-05-18 23:19 刘梦磊 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#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 刘梦磊 阅读(16) 评论(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 刘梦磊 阅读(25) 评论(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 刘梦磊 阅读(13) 评论(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 刘梦磊 阅读(29) 评论(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 刘梦磊 阅读(23) 评论(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 刘梦磊 阅读(10) 评论(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 刘梦磊 阅读(47) 评论(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 刘梦磊 阅读(47) 评论(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 刘梦磊 阅读(76) 评论(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 刘梦磊 阅读(66) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; enum myColor { BLACK, WHITE }; class Mammal { public: //constructors Mammal(); ~Mammal(); //accessors int get 阅读全文
posted @ 2023-05-07 21:02 刘梦磊 阅读(126) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; class Clock { public: Clock(); void setTime(int newH, int newM, int newS); void showTime(); private: int hour, 阅读全文
posted @ 2023-05-06 23:09 刘梦磊 阅读(144) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; #include<string> class people { public: void setValue(int m, string str) { age = m; name = str; } void display 阅读全文
posted @ 2023-05-05 23:39 刘梦磊 阅读(72) 评论(0) 推荐(0) 编辑
摘要:#include <iostream>#include<string>using namespace std;class Person {public: int age; Person(int age) { this->age = age; } Person& aaa(Person& p) { th 阅读全文
posted @ 2023-05-04 20:51 刘梦磊 阅读(69) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示