上一页 1 ··· 68 69 70 71 72 73 74 75 76 ··· 95 下一页
摘要: 题目:求字符串的最长非重复子序列。比如字符串“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)
摘要: 1:给定三个整数a,b,c实现函数int median(int a,int b,int c),返回三个数的中位数,不可以使用sort,要求整数操作(比较,位运行,加减乘除)次数尽量少,并分析说明程序最坏和平均情况下使用的操作次数#include <stdio.h> #include <iostream>using namespace std;int median(int a,int b,int c){ int abMax = (a+b + abs(a-b))/2; int acMax = ((a+c) + abs(a-c))/2; if(abMax != acMax) 阅读全文
posted @ 2012-11-07 16:44 byfei 阅读(200) 评论(0) 推荐(0)
摘要: int numn,numm; cin>>numn>>numm;//两个数组的长度 int *n = new int[numn]; int *m = new int[numm]; 阅读全文
posted @ 2012-11-06 17:49 byfei 阅读(130) 评论(0) 推荐(0)
摘要: 1.在括号内填入一个字,使之既有前一个词的意思,又有后一个词的意思 顶部()震荡顶部(颠) 震荡注:没有山字头的,颠:既有颠峰之意,又有颠簸震荡之意有山字头的只有山顶的意思2.41,(28),27,83,(),65我是这样解 : 41 - 27 = 1414 × 2 = 28 即括弧里的数目因此,依此类推 83 - 65 = 1818 × 2 = 36答案是:363.961 (25) 432 932 (___) 731 请写出"___"处的数字 求解96=32×3 9+6=15 3+2=5 公约数取5 中间 1+4=5 所以5*5=25 93= 阅读全文
posted @ 2012-11-06 16:06 byfei 阅读(319) 评论(0) 推荐(0)
摘要: 英文原文:A Google Interviewing Story 很多年前我进入硅谷人才市场,当时是想找一份高级工程师的职位。如果你有一段时间没有面试过,根据经验,有个非常有用的提醒你应该接受,就是:你往往会在前几次面试中的什么地方犯一些错误。简单而言就是,不要首先去你梦想的公司里面试。面试中有多如牛毛的应该注意的问题,你可能全部忘记了,所以,先去几个不太重要的公司里面试,它们会在这些方面对你起教育(再教育)作用。 我第一家面试的公司叫做gofish.com,据我所知,gofish这家公司如今的情况跟我当时面试时完全的不同。我几乎能打保票的说,当时我在那遇到的那些人都已不再那工作了,这家公.. 阅读全文
posted @ 2012-11-06 15:18 byfei 阅读(183) 评论(0) 推荐(0)
摘要: 一:通过键盘输入任意一个字符串序列,字符串可能包含多个子串,子串以空格分隔,请编写一个程序,自动分离出各个子串,并使用’,’将其分隔,并且在最后也补充一个’,’,并将子串存储。如果输入”abc def ghi d”,结果将是abc,def,gh,i,d,要求实现函数Void DivideString(const char *pInputStr,long IinputLen,char *pOutputStr);输入:pInputStr:输入字符串IinputLen:输入字符串的长度输出:pOutputStr:输出字符串,字符串已开辟好,与输入字符串等长注意:只需要完成该函数功能算法,中间不需要有 阅读全文
posted @ 2012-11-06 10:46 byfei 阅读(240) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;int main(){ int a=1; char b = (char)(a+48); int c = (int)(b-48); if(b == '1') cout<<b<<endl; if(c == 1) cout<<c<<endl; getchar();} 阅读全文
posted @ 2012-11-02 19:46 byfei 阅读(174) 评论(0) 推荐(0)
摘要: 一:给定一个字符串,寻找它的一个最大子字符串,该子字符串是回文。例如给定一个用例的字符串”gabcdcbaef”,那么最大回文 字串是”abcdcba”函数声明为void huiwen(char input[], int len, char output[])#include <string>#include <iostream>using namespace std;//如果是回文字符串,那么从字符串的最中间向两头分别遍历,则应该都是相等的void huiwen(char input[],int len, char output[]){ //start表示回文字串的起 阅读全文
posted @ 2012-11-02 11:49 byfei 阅读(221) 评论(0) 推荐(0)
摘要: 1.#include <windows.h>sleep () 2.#include <WinBase.h>GetTickCount()3.#include <memory.h>void *memcpy(void *dest, const void *src, size_t n); //从源src所指的内存地址的起始位置开始拷贝n个字节到目标dest所指的内存地址的起始位置中4.#include <string>strcpy();5.#include<algorithm>sort();6.#include <assert.h> 阅读全文
posted @ 2012-11-01 14:49 byfei 阅读(375) 评论(0) 推荐(0)
上一页 1 ··· 68 69 70 71 72 73 74 75 76 ··· 95 下一页