wxy

归档

2023 年 12 月

四舍六入五成双 #include<bits/stdc++.h> using namespace std; int main(){ printf("%.2f\n",9.825); //输出9.82 printf("%.2f\n",9.825001); //输出9.83 printf("%.2f\
lower_bound & upper_bound #include<bits/stdc++.h> using namespace std; int main(){ vector<int> v={1,2,3,4,5}; auto p = lower_bound(v.begin(),v.end(

2023 年 11 月

2023 年 10 月

2023 年 05 月

#include&lt;bits/stdc++.h&gt;using namespace std;const int m = 10; //树的度typedef struct node Node;typedef node *tree;struct node{char data;

2023-05-06

#include&lt;bits/stdc++.h&gt;using namespace std;struct student{//成员变量string name;int x,y;//无参数构造函数student(){}//带参数构造函数student(int x1,int y1):x(x1),y(

2023 年 03 月

2023-03-07

1198:逆波兰表达式1201:菲波那契数列1202:Pell数列1204:爬楼梯1205:汉诺塔问题1207:求最大公约数问题1208:2的幂次方表示

2023-03-04

传值与传地址#include&lt;bits/stdc++.h&gt;using namespace std;//传值void f1(int a,int b){int t=a;a=b;b=t;}//传地址void f2(int &amp;a,int &amp;b){int t=a;a=b;b=t;}