-
最大公约数 最小公倍数
#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; int greatest_common_divisor1(int a,int b){ //辗转相减法 while(a!=b){ if(a>b) -
10进制转k进制
#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; void k_system(int n,int k){ //n:十进制数,k为进制 int t=n; int m=0; int a[10]; -
回文数
#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; bool hui_number(int n){ int t=n; int k=0; int a[10]; while(t>0){ //提前数的 -
水仙花数
#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; bool Narcissistic_number(int n){ int t=n; int a[3]; int k=0; while(t>0) -
杨辉三角
用一维数组或二维数组打印杨辉三角 #include <stdlib.h> #include <math.h> #include <iostream> using namespace std; int a[15][15]; int aa[1024]; void yang_2D(){//二维数组打印杨辉 -
素数
#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; bool prime(int x){ for(int i=2;i*i<=x;i++){ if(x%i==0) return false; } -
React的生命周期函数
content -
React钩子函数之 useEffect()
content -
hook钩子函数UseState() 详解setState和useState
test -
组件和props
编写JavaScript函数 function Welcome(props) { return <h1>Hello, {props.name}</h1>; } ES6的class组件来定义组件