05 2023 档案

摘要:#include <bits/stdc++.h> using namespace std; class ExamInfo { public: ExamInfo(string name,char grade) :name(name),mode(GRADE),grade(grade){} ExamInf 阅读全文
posted @ 2023-05-26 18:22 记得关月亮 阅读(4) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; struct Student{ int num; string name; char sex; int age; }; int main() { Student stu={97001,"Lin Lin",'F 阅读全文
posted @ 2023-05-25 16:25 记得关月亮 阅读(4) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; class Point { public: Point(int xx=0,int yy=0) { x=xx; y=yy; } Point(Point &p); int getX() { return x; } 阅读全文
posted @ 2023-05-24 18:41 记得关月亮 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; const float PI=3.141593; const float FENCE_PRICE=35; const float CONCRETE_PRICE=20; class Circle { publi 阅读全文
posted @ 2023-05-23 18:23 记得关月亮 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; class Clock { public: void settime(int newH=0,int newM=0,int newS=0); void showtime(); private: int hour 阅读全文
posted @ 2023-05-22 16:46 记得关月亮 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int getpower(int x, int y) { if (y < 0) return 0; else if (y == 0) return 1; else if (y == 1) return x; else 阅读全文
posted @ 2023-05-19 17:06 记得关月亮 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; double f(int n,int x) { if(n==0) return 1; else if(n==1) return x; else return ((2*n-1)*x*f(n-1,x)-(n-1) 阅读全文
posted @ 2023-05-18 16:56 记得关月亮 阅读(9) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int f(int n) { if(n==1||n==2) return 1; else return f(n-1)+f(n-2); } int main() { int a; cin>>a; cout<<f 阅读全文
posted @ 2023-05-17 10:23 记得关月亮 阅读(11) 评论(0) 推荐(0) 编辑
摘要:#include<bits/stdc++.h> using namespace std; int f(int n) { if(n==1) return 1; else return f(n-1)+n; } int main() { int a; cin>>a; cout<<f(a)<<endl; r 阅读全文
posted @ 2023-05-16 15:39 记得关月亮 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int M(int x,int y){//定义一个函数M求最大值 if(x<y){ int i; i=x; x=y; y=i; } while(y){ int j; j=x%y; x=y; y=j; } re 阅读全文
posted @ 2023-05-15 17:07 记得关月亮 阅读(7) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; bool Prime(int n) { bool flag=true; if(n<=1) return false; else { for(int i=2;i<n;i++) { if(n%i==0) { fl 阅读全文
posted @ 2023-05-12 17:04 记得关月亮 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; double trans(double f) { double c; c=5.0/9*(f-32); return c; } int main() { double F; cin>>F; cout<<tran 阅读全文
posted @ 2023-05-11 15:29 记得关月亮 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; short int hanshu(unsigned short int x,unsigned short int y) { if(y==0) return -1; else return x/y; } int 阅读全文
posted @ 2023-05-10 10:48 记得关月亮 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; const double PI=3.14159265358979; inline double calArea(double radius) { return PI*radius*radius; } int 阅读全文
posted @ 2023-05-09 19:31 记得关月亮 阅读(10) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; void swap(int &a,int &b) { int t=a; a=b; b=t; } int main() { int x=5,y=10; cout<<"x="<<x<<" y="<<y<<endl 阅读全文
posted @ 2023-05-08 16:15 记得关月亮 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; void move(char src,char dest){ cout<<src<<"-->"<<dest<<endl; } void hanoi(int n,char src,char medium,cha 阅读全文
posted @ 2023-05-06 16:09 记得关月亮 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int comm(int n,int k) { if(k>n) return 0; else if(n==k||k==0) return 1; else return comm(n-1,k)+comm(n-1 阅读全文
posted @ 2023-05-05 15:18 记得关月亮 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; unsigned fac(unsigned n) { unsigned f; if(n==0) f=1; else f=fac(n-1)*n; return f; } int main() { unsigne 阅读全文
posted @ 2023-05-04 16:12 记得关月亮 阅读(14) 评论(0) 推荐(0) 编辑

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