摘要: #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 记得关月亮 阅读(11) 评论(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 记得关月亮 阅读(16) 评论(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 记得关月亮 阅读(7) 评论(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 记得关月亮 阅读(10) 评论(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 记得关月亮 阅读(12) 评论(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 记得关月亮 阅读(12) 评论(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 记得关月亮 阅读(10) 评论(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 记得关月亮 阅读(13) 评论(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 记得关月亮 阅读(18) 评论(0) 推荐(0)
摘要: #include <iostream> #include <iomanip> #include <cmath> using namespace std; int fun2(int m){ return m*m; } int fun1(int x,int y){ return fun2(x)+fun2 阅读全文
posted @ 2023-04-28 20:09 记得关月亮 阅读(6) 评论(0) 推荐(0)