摘要:
题目:求字符串的最长非重复子序列。比如字符串“dabaccdeff”,它的最长非重复子序列为“dabcef”#include<iostream>#include <stack> #include<stdlib.h>using namespace std;int NoReplicatedSubstring(char *s,int len){ const int tablesize=256; char hashtable [tablesize] = {'0'}; int count=0; for(int i=0;i<len;i++) has 阅读全文
posted @ 2012-11-08 21:35
byfei
阅读(222)
评论(0)
推荐(0)
摘要:
1:如下,是一个“4×4”的数字矩阵,请找出其中的规律,然后编写一个程序,要求能打印出“N×N”时的数字矩阵:1 23 41213145111615610 98 7请用自己最熟悉的语言编写,或者用自然语言描述。至少要包括下列内容:1: 数字矩阵的规律2: 采用的数据结构3:关键的控制流程 #include<iostream> #include<cmath> #define N 4 using namespace std; int main() { int i,j; int count=0; int a[N][N]; for(i=0;i<N/2; 阅读全文
posted @ 2012-11-08 17:05
byfei
阅读(300)
评论(0)
推荐(0)

浙公网安备 33010602011771号