- 博客(79)
- 收藏
- 关注
原创 求Fibonacci数列的前40个数。即F_1=1,F_2=1,F_n=F_(n-1)+F_(n-2) (n≥3)。
import java.util.Scanner;import static java.lang.System.out;import static java.lang.Math.*;public class xy { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] a = new int[40]; int i ;
2021-03-11 17:13:41 503
原创 求100至200间的全部素数。
package z;import java.util.Scanner;import static java.lang.System.out;import static java.lang.Math.*;public class xy { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int flag,i,j; for(i =
2021-03-11 17:01:26 408
原创 用公式π/4=1-1/3+1/5-1/7...求π的近似值,直到发现某一项的绝对值小于10^-6(1e-6)为止(该项累加或不累加)
1 累加import java.util.Scanner;import static java.lang.System.out;import static java.lang.Math.*;public class xy { public static void main(String[] args) { double pi = 0,flag = 1.0,sum = 0,m = 1; int k = 1; while (abs(m) &
2021-03-10 19:00:33 2236
原创 鸡兔同笼问题
package z;import java.util.Scanner;import static java.lang.System.out;import static java.lang.Math.*;public class xy { public static void main(String[] args) { int x,y; for(x = 0;x <= 35;x++) { y = 35 - x
2021-03-10 18:18:52 183
原创 判断某个数是不是水仙花数
package z;import java.util.Scanner;import static java.lang.System.out;import static java.lang.Math.*;public class xy { public static void main(String[] args) { int n ,a,b,c; Scanner input = new Scanner(System.in); Syst.
2021-03-09 18:57:19 106
原创 PAT1071
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>#include <map&g.
2021-02-20 21:52:44 71
原创 PAT1070
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>#include <map&g.
2021-02-20 21:51:39 60
原创 PAT1069
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>#include <map&g.
2021-02-20 21:50:10 62242
原创 PAT1068
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>#include <map&g.
2021-02-20 21:49:13 74
原创 PAT1067
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-20 21:48:13 91
原创 PAT1066
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-20 21:46:50 97
原创 PAT1065
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-18 21:20:30 82
原创 PAT1064
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-18 21:19:36 63
原创 PAT1063
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-18 20:02:57 97
原创 PAT1062
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-17 21:17:10 64
原创 PAT1061
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-17 21:16:13 109 2
原创 PAT1060
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-17 09:54:46 78
原创 PAT1059
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace st.
2021-02-15 22:32:29 144
原创 PAT1058
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>#include <set>using namespace s..
2021-02-14 23:36:46 104
原创 PAT1057
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main() { st.
2021-02-13 22:16:04 91
原创 PAT1056
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main() { in.
2021-02-13 10:37:33 67
原创 PAT1055
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;struct people { s.
2021-02-10 22:59:21 69
原创 PAT1054
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main() { int.
2021-02-08 22:12:37 59
原创 PAT1053
观察期超过D,不是用电低的天数超过D,不要理解错了#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespa
2021-02-07 22:43:02 86
原创 PAT1052
下面展示一些 内联代码片。// A code blockvar foo = 'bar';#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algori
2021-02-07 20:35:06 55
原创 PAT1050
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int a[10000], s[1.
2021-02-06 21:53:05 63
原创 PAT1051
复数可以写成 (A+Bi) 的常规形式,其中 A 是实部,B 是虚部,i 是虚数单位,满足 i2=−1;也可以写成极坐标下的指数形式 (R×e(Pi)),其中 R 是复数模,P是辐角,i 是虚数单位,其等价于三角形式 (R(cos§+isin§)。分析因为 R1(cos(P1)+isin(P1))x R2(cos(P2)+isin(P2))=R1R2(cos(P1)cos(P2)- sin(P1)sin(P2)+(cos(P1)sin(P2)+sin(P1)cos(P2)) i)即R1R2
2021-02-06 14:55:56 70
原创 PAT1049
感觉题目有问题,这个代码目前可以通过#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;
2021-02-05 18:11:30 87
原创 PAT1048
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ stri.
2021-02-05 17:33:00 73
原创 PAT1047
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ int .
2021-02-05 16:14:50 57
原创 PAT1046
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ int .
2021-02-04 22:17:22 58
原创 PAT1045
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ int .
2021-02-04 22:07:39 66
原创 PAT1044
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;string a[13] = { ".
2021-02-04 20:10:23 72
原创 PAT1043
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ stri.
2021-02-04 16:04:13 50
原创 PAT1042
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ stri.
2021-02-04 11:40:49 106
原创 PAT1041
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ stri.
2021-02-03 21:58:14 94
原创 PAT1040
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ stri.
2021-02-03 21:05:37 112
原创 PAT1039
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include <ctype.h>#include<algorithm>using namespace std;int main(){ stri.
2021-02-03 20:06:05 75
原创 PAT1038
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include<algorithm>using namespace std;int main(){ int a[101] = { 0 }; int n, i.
2021-02-03 16:08:37 65
原创 PAT1037
#include<iostream>#include <iomanip>#include <cstdio>#include<string>#include<vector>#include<array>#include<math.h>#include<algorithm>using namespace std;int main(){ int a1, a2, b1, b2, c1, c2; .
2021-02-02 21:53:40 110
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人