摘要: 使用32个元素的数组代表unsigned int型数字(32 bit)的加法。 1 #include <stdbool.h> 2 #include <stdio.h> 3 4 unsigned int num1[32]; 5 unsigned int num2[32]; 6 unsigned int 阅读全文
posted @ 2023-07-20 21:33 安然春夏 阅读(112) 评论(0) 推荐(0)
摘要: 239个梅森数,x=2^239-1=883423532389192164791648750371459257913741948437809479060803100646309887 小于10000的因子:479, 1913, 5737 python和java BigInteger计算结果一致。 阅读全文
posted @ 2023-07-20 15:57 安然春夏 阅读(11) 评论(0) 推荐(0)
摘要: f(x)=sin(x) 的逆函数 y=asin(x),定义域[-1,1],值域[-pi/2, pi/2]+n*pi, n=0 g(x)=cos(x) 的逆函数 y=acos(x),定义域[-1,1],值域[0, pi]+n*pi, n=0 t(x)=tan(x) 的逆函数 y=atan(x),定义域 阅读全文
posted @ 2023-07-20 12:42 安然春夏 阅读(105) 评论(0) 推荐(0)
摘要: 连分数x=[a0; a1,a2,a3,a4,a5,a6....] = p/q 0级近似:a0/1 = p0/q0 p0=a0, q0=1 1级近似:a0+1/a1=(a0*a1+1)/a1 = p1/q1 = (a1*p0+p-1)/(a1*q0+q-1) p-1=1, q-1=0 2级近似:a0+ 阅读全文
posted @ 2023-07-20 03:52 安然春夏 阅读(34) 评论(0) 推荐(0)
摘要: img[i][j]周围的单元格,img[i+i1][j+j1], i1=-1,0,1, j1=-1,0,1, 每个都判断一次。O(9*m*n) class Solution { public: std::vector<std::vector<int>> imageSmoother( std::vec 阅读全文
posted @ 2023-07-20 00:54 安然春夏 阅读(40) 评论(0) 推荐(0)
摘要: 1 class Solution { 2 public: 3 string toLowerCase(string s) { 4 for(char &ch: s){ 5 if(ch>='A' && ch<='Z'){ 6 ch=tolower(ch); 7 } 8 } 9 return s; 10 } 阅读全文
posted @ 2023-07-20 00:49 安然春夏 阅读(12) 评论(0) 推荐(0)