上一页 1 ··· 6 7 8 9 10 11 12 下一页

2015年10月7日

斐波那契数列

摘要: 1 //计算斐波那契数列 f(n) 2 3 #include 4 #include 5 using namespace std; 6 7 long fib1(int n){ 8 /*递归程序1:这种是最原始的想法,这样的做法会重复调用,做很多无用的工作。下面是优... 阅读全文

posted @ 2015-10-07 00:47 逸阳 阅读(209) 评论(0) 推荐(0)

2015年10月6日

枚举

摘要: 先曝上sicily上的一道题吧,soj4190.原题如下:---------------------------------------------------------------------------------------------------------------4190. Prim... 阅读全文

posted @ 2015-10-06 18:59 逸阳 阅读(345) 评论(0) 推荐(0)

2015年10月3日

ural Infernal Work

摘要: Infernal Work Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Infernal Work Description Railwaymen Vassily and Pyotr died and wer 阅读全文

posted @ 2015-10-03 15:23 逸阳 阅读(268) 评论(0) 推荐(0)

2015年9月28日

ural One-two, One-two 2

摘要: One-two, One-two 2 Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Description One-two, One-two 2 Description A year ago the famo 阅读全文

posted @ 2015-09-28 10:20 逸阳 阅读(230) 评论(0) 推荐(0)

2015年9月24日

一元多项式的加减乘法

摘要: 输入一元多项式的参数,然后根据一元多项式加法减法乘法的计算法则,求解最终结果。用到了结构体,指针,操作的时候要注意。不多说,上代码: 1 #include 2 #include 3 4 typedef struct node{ 5 float coef; 6 int... 阅读全文

posted @ 2015-09-24 22:06 逸阳 阅读(1095) 评论(1) 推荐(1)

2015年9月23日

ural Cipher Message

摘要: Cipher Message Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Cipher Message Description Müller tried to catch Stierlitz red-han 阅读全文

posted @ 2015-09-23 23:52 逸阳 阅读(292) 评论(0) 推荐(0)

快速幂取模算法

摘要: 问题:求解ab%c1.首先看最原始的做法:1 int num=1;2 for(int i=1;i0){4 if(b%2==1){5 num=(num*a)%c; 6 }7 b/=2; //这一步将b->log2(b) 8 a=(a*a)%... 阅读全文

posted @ 2015-09-23 00:52 逸阳 阅读(1339) 评论(0) 推荐(0)

2015年9月19日

蛇形填充

摘要: 蛇形填充 1 //局限性:由于编译框显示限制,只能实现1-20的功能 2 #include 3 #include 4 using namespace std; 5 #define MAXN 20 6 int a[MAXN][MAXN]; 7 8 int main(){ 9 int ... 阅读全文

posted @ 2015-09-19 17:57 逸阳 阅读(404) 评论(0) 推荐(0)

矩阵相乘

摘要: 矩阵相乘的程序: 1 #include 2 #include 3 4 bool check(int row1,int col1,int row2,int col2){//检测两个矩阵是否可以相乘 5 if(row1>0&&col1>0&&row1>0&&col2>0){ 6 ... 阅读全文

posted @ 2015-09-19 14:24 逸阳 阅读(212) 评论(0) 推荐(0)

2015年9月18日

计算2的N次方&&计算e

摘要: 2的N次方注意:这里在处理的时候并没有用循环来处理,而是用移位的做法。 n 2 #include 3 int main(){ 4 int time; 5 printf("要求出2的多少次方:"); 6 scanf("%d",&time) ; 7 int n... 阅读全文

posted @ 2015-09-18 21:47 逸阳 阅读(381) 评论(0) 推荐(0)

上一页 1 ··· 6 7 8 9 10 11 12 下一页

导航