![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
日常练习
zc186v
这个作者很懒,什么都没留下…
展开
-
螺旋矩阵
//法一:螺旋矩阵递归做法,其实不用递归 #include "stdafx.h" #include using std::cout; using std::cin; using std::endl; void LuoXuanArray(int a[], int n) { static int m = 0; static int p = 0, q = n-1; int i = p,原创 2013-10-07 22:29:38 · 471 阅读 · 0 评论 -
日常练习
//将bitset对象1、2、3、5、8、13、21位置为1//方法1:初始化1、2、3、5、8、13、21位为1 bitset test;for(int index = 0; index!=32; index++){switch(index){case 1:case 2:case 3:case 5:case 8:case 13:case 21:test[index] = 1;break;defa原创 2013-09-25 11:05:30 · 528 阅读 · 0 评论 -
动态规划算法求两个字符串的最大公共子串
//获取两个字符串公共子串 int GetMaxCommonSubStr(string &strFirst, string &strSecond) { if((strFirst=="") || (strSecond=="")) { return 0; } int i, j; int iLenFirst = strFirst.length(); int iLenSecond = s原创 2014-09-03 14:29:32 · 1037 阅读 · 0 评论