上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 22 下一页
摘要: 1 //快速幂运算 2 long power_n(int n,int b){//n^b 3 long res=1;//注意是等于1 4 while(b>0){ 5 if(b&1)//取幂数的最后一位 6 res*=n; 7 b>>=1;//右移一位 8 n=n*n;//加权 9 10 } 11 re 阅读全文
posted @ 2020-07-06 21:37 安之若醇 阅读(123) 评论(0) 推荐(0)
摘要: 1 #include <iostream> 2 #include <algorithm> 3 4 using namespace std; 5 int a[100]; 6 int binarysearch(int a[],int size,int att){ 7 sort(a,a+size);//一 阅读全文
posted @ 2020-07-06 18:45 安之若醇 阅读(239) 评论(0) 推荐(0)
摘要: ....又是以前虐过我的期末习题..哪里摔倒就哪里爬起来吧 1 #include<iostream> 2 #include<math.h> 3 #define N 1e-3 4 using namespace std; 5 6 bool IsZero(double a){ 7 return abs( 阅读全文
posted @ 2020-07-06 18:19 安之若醇 阅读(271) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-07-05 17:48 安之若醇 阅读(274) 评论(0) 推荐(0)
摘要: 题外话: 某天晚上梦见更了五六篇博客而不知疲惫. 如果这是现实该多好啊哈哈哈!美梦成真吧! 中项表达式就是最普通的表达式.也是几个小定义来回递归.这个题在去年期末上机题中出现过,但是比这个还有难一些. 呜呜呜,去年的我啥都不会(当然现在也是),为难我干什么呀!!!! 解: 1 #include <i 阅读全文
posted @ 2020-07-05 17:31 安之若醇 阅读(164) 评论(0) 推荐(0)
摘要: 挺简单的代码吧,,,就是那个return ...... 1 #include <iostream> 2 using namespace std; 3 int n; 4 void hanoi(int n,char src,char mid,char des){ 5 if(n==1){ 6 cout<< 阅读全文
posted @ 2020-07-05 15:54 安之若醇 阅读(158) 评论(0) 推荐(0)
摘要: 1 /*可以用回溯,但是我已经不太熟悉回溯了!!!!!!!!呜呜呜 2 * 3 */ 4 #include <iostream> 5 #include <math.h> 6 using namespace std; 7 /* 8 * 这个地方我确实没有想到 9 * 我不知道怎么判断两个符号的作用对象 阅读全文
posted @ 2020-07-03 22:27 安之若醇 阅读(272) 评论(0) 推荐(0)
摘要: // // #include <stdio.h> /*可以用回溯,但是我已经不太熟悉回溯了!!!!!!!!呜呜呜 * */ #include <iostream> #include <math.h> using namespace std; int a[9]={0}; //bool b[100]={ 阅读全文
posted @ 2020-07-03 21:16 安之若醇 阅读(145) 评论(0) 推荐(0)
摘要: 1 #include <iostream> 2 #include<string.h> 3 using namespace std; 4 char Lleft[3][100]; 5 char Lright[3][100]; 6 char result[3][100]; 7 bool wight(cha 阅读全文
posted @ 2020-07-02 22:45 安之若醇 阅读(181) 评论(0) 推荐(0)
摘要: 1 #include <iostream> 2 #include<cstdio> 3 using namespace std; 4 int main(){ 5 int p,e,i,d; 6 int num=0; 7 while(1){ 8 cin>>p; 9 if(p 1) 10 break; 11 阅读全文
posted @ 2020-07-02 21:09 安之若醇 阅读(142) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 22 下一页
Live2D服务支持