
Interview
njyzf
这个作者很懒,什么都没留下…
展开
-
百度笔试题
int maxContinuNum(const char *inputstr,char * outputstr){ bool flag=false; char *cur=NULL; char *p=(char *)inputstr; int len=0; int maxLen=0; while(*p) { if((*p>='0')&&(*p {原创 2012-09-09 13:42:38 · 694 阅读 · 0 评论 -
踩方格--2013微软编程之美挑战赛之测试赛
时间限制: 1000ms 内存限制: 1024MB描述有一个方格矩阵,矩阵边界在无穷远处。我们做如下假设:a. 每走一步时,只能从当前方格移动一格,走到某个相邻的方格上;b. 走过的格子立即塌陷无法再走第二次;c. 只能向北、东、西三个方向走;请问:如果允许在方格矩阵上走n步,共有多少种不同的方案。2种走法只要有一步不一样,即被认为是不同的方案。输入允许在方格上行原创 2013-04-05 20:51:38 · 2458 阅读 · 0 评论 -
2012微软暑期实习生笔试题
2012微软暑期实习生笔试题IT笔试面试题整理2012 Microsoft Intern Hiring Written Test1. Suppose that a Selection Sort of 80 items has completed 32 iterations of the main loop. How many items are now guaran转载 2013-04-01 09:34:03 · 828 阅读 · 0 评论 -
一个简单的计算器模拟程序-2011腾讯笔试填空题
【说明】本程序是一个简单计算器模拟程序。对任意给定的正确四则运算表达式,程序计算其结果值并输出。表达式中运算分量为无正负号的整数,运算符为+ - * / ,圆括号按常规配对,表达式以字符“=”结束。函数getch()为获取表达式的一个合法字符,并将字符存入变量curch;函数指针数组func[]是为了统一加减乘除计算而设置的。(红色为需要补充的部分)#include原创 2013-03-25 15:04:40 · 1559 阅读 · 0 评论 -
趋势科技几道笔试题
1. What is the output of the following program?#includeusing namespace std;int findChar(char *str,char ch){ for(unsigned int i=strlen(str)-1;i>=0;--i) { if(str[i]==ch) return i; } re原创 2013-03-26 21:09:40 · 1268 阅读 · 0 评论 -
考数据在内存布局的小题目
在X86系统中,问下面程序输出什么?int check(){ union utype { inti; charc; }; utype u; u.i=1; returnu.c==1;} int main原创 2013-04-10 22:56:39 · 555 阅读 · 0 评论 -
不用任何位操作,获得一个int变量的第九位
不用任何位操作(&、|、^、>、~),实现一个函数,得到一个int型数的第九位(从第一位开始计数)int check(){ union utype { int i; char c; }; utype u; u.i=1; return u.c==1;}int getbit(int val){ char *p=(char *)&val; p++; i原创 2013-04-11 14:41:47 · 738 阅读 · 0 评论 -
C++ 英语笔试题
Question 4: Which of the following statements correctly describe the code below in C++?#define language 437 //Line 1#if language #undef language //Li转载 2013-03-30 12:03:48 · 4029 阅读 · 1 评论 -
大数乘法
void multiply(){ char str1[1000],str2[1000]; cin>>str1>>str2; int len1 = strlen(str1); int len2 = strlen(str2); int len = len1 + len2 + 1; int *A = new int[len1]; int *B = new int[len2]; int原创 2013-10-27 19:10:04 · 745 阅读 · 0 评论 -
打印迷宫路径
bool doMaze(int m,int n, int matrix[][6], int x,int y){ if(!x&&!y) { cout<<"("<<x<<","<<y<<") "; return true; } bool flag=false; //go left if(y>0&&!matrix[x][y-1]) { matrix[x][y-1]=1;原创 2013-10-27 20:01:37 · 1106 阅读 · 0 评论 -
微软2013校园招聘笔试题(9.22 第一次笔试)
微软2013校园招聘笔试题(9.22 第一次笔试)原题参考:http://xiangce.baidu.com/picture/album/list/30f4de574d08016a99f5670763ca0e936d7b0793把微软的这个笔试题贴出来,纯粹是为了方便大家学习交流,相信微软不会那么小气来追究我的责任吧。确实觉得微软出的这些题都不错,虽然只有20道选择,但是考察的面很转载 2013-04-01 11:13:42 · 760 阅读 · 0 评论 -
一百题系列之二十五
第25题:写一个函数,它的原形是int continumax(char *outputstr,char *intputstr)功能:在字符串中找出连续最长的数字串,并把这个串的长度返回,并把这个最长数字串付给其中一个函数参数outputstr所指内存。例如:"abcd12345ed125ss123456789"的首地址传给intputstr后,函数将返回9,outputst原创 2013-03-13 15:26:40 · 1126 阅读 · 0 评论 -
面试中常被问到的问题
1、写一个“标准”宏交换两个参数的宏定义为:#define SWAP(a,b) (a)=(a)+(b);(b)=(a)-(b);(a)=(a)-(b);#define SWAP(x,y) x=x*y;y=x*y;x=x*y; //要求x,y不等输入两个参数,输出较小的一个:#define MIN(A,B) ((A)2、位操作:给定一个整型变量a ,写两段代码,第原创 2012-10-25 09:18:47 · 354 阅读 · 0 评论 -
merge空间复杂度O(1)
////问题://数组al[0,mid-1] 和 al[mid,num-1],都分别有序。将其merge成有序数组al[0,num-1],要求空间复杂度O(1)//// #includeusing std::cout;using std::cin;using std::endl;void swap(int &a,int &b){ int t=a; a=原创 2012-11-20 11:27:00 · 1299 阅读 · 1 评论 -
皇后问题
1)8皇后问题:#includeusing std::cout;using std::endl;#define my_abs(x) ((x)>=0?(x):(-(x)))const int n=8;void output(int a[],int n){static int count=1;cout<<"this is the "<<count<<"th answer"<<原创 2012-11-21 09:48:09 · 550 阅读 · 0 评论 -
2012 小米春季招聘的两个编程题
一、设计一个类MList,它维护一个整数列表(初始为空),并提供了三个方法:1、把一个整数添加到列表末尾2、把当前列表翻转3、顺序输出当前列表中的所有元素 请完善该类定义中的...部分(算法效率越高越好) class MList{...void add(int value){...}void reverse(){...}void print(){..原创 2012-11-22 09:53:06 · 430 阅读 · 0 评论 -
2012年软件设计师一道操作系统题
2012年软件设计师一道操作系统题 设文件索引节点有8个地址项,每个地址项大小为4字节,其中5个地址项为直接地址索引,2地址项为一级间接索引,1个地址项为二级间接索引。磁盘索引块和磁盘数据块大小均为1KB。若要访问文件的逻辑号分别为5和518,则系统应分别采用(27);而且可表示的单个文件最大长度为(28)KB。 27:A.直接地址索引和一级间接地址索引B.直接地址索引和二原创 2013-01-24 13:54:53 · 4551 阅读 · 5 评论 -
趋势科技一道编程题
题目:编写一个函数int search(char *text),text为输入的字符串,从字符串中找出一个最长的不含重复字符的子字符串,例如“axdbx”,返回4,子字符串为“axdb”,而“axdbxce”,返回5,子字符串为“dbxce”。#include#includeusing namespace std;int search(char *text原创 2013-01-27 14:46:04 · 1561 阅读 · 2 评论 -
poj-1611
http://poj.org/problem?id=1611The SuspectsTime Limit: 1000MS Memory Limit: 20000KTotal Submissions: 16697 Accepted: 8020DescriptionSevere acute respiratory原创 2013-01-30 18:26:53 · 563 阅读 · 0 评论 -
poj-1002
http://poj.org/problem?id=1002487-3279Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 204325 Accepted: 35622DescriptionBusinesses like to have m原创 2013-01-30 17:15:29 · 796 阅读 · 0 评论 -
约瑟夫环问题
第18题:题目:n个数字(0,1,…,n-1)形成一个圆圈,从数字0开始,每次从这个圆圈中删除第m个数字(第一个为当前数字本身,第二个为当前数字的下一个数字)。当一个数字删除后,从被删除数字的下一个继续删除第m个数字。求出在这个圆圈中剩下的最后一个数字。#includeusing namespace std;int joseph(int n,int m){ int原创 2013-03-02 20:34:21 · 572 阅读 · 0 评论 -
Use VS2017 C# 7.0 to accelerate async code
Reference: http://www.debug.is/2015/04/17/c-sharp-vs-go/http://www.jb51.net/article/108159.htmBefore VS2017 C# 7:using System;using System.Collections.Generic;using System.Diagnostic原创 2017-08-13 20:27:50 · 368 阅读 · 0 评论