05 2023 档案
摘要:#include <bits/stdc++.h> using namespace std; class ExamInfo { public: ExamInfo(string name,char grade) :name(name),mode(GRADE),grade(grade){} ExamInf
阅读全文
摘要:#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
阅读全文
摘要:#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; }
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#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)
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const double PI=3.14159265358979; inline double calArea(double radius) { return PI*radius*radius; } int
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文
摘要:#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
阅读全文