好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

2023年北京中软笔试题.doc

7页
  • 卖家[上传人]:M****1
  • 文档编号:537254268
  • 上传时间:2024-01-15
  • 文档格式:DOC
  • 文档大小:23.54KB
  • / 7 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • 北京中软笔试题 1.不许用中间变量,把String ABCDE 倒转 2.10000个数求第2大的数,不许用排序算法. 3.排序算法的测试用例 我的答案: 1. 1. include "stdafx.h" 1. include 1. include using namespace std; int _tmain(int argc, _TCHAR* argv[]) {  char *ps = new char[15];  strcpy_s(ps,15,"I am yuchifang");  cout<<"before reverse:"<

      4、假如微软给你500万美元项目经费,你怎么运用它? 5、你对考研是什么态度? 6、你对加班是什么态度? 这个答案项目经理说出来后我感觉太现实了,你猜他怎么说的?和IT人有关的 7、Why do you …… ICS&S? (我忘具体怎么说的了,大意就是问你为什么要来中软国际?人家可是用全英语问的,说的挺快的,幸好我听懂一点)   问题太多了,大多是技术问题,但是都和知识要点有关,不考太难的太复杂的,但是我还是大部分不会啊!!!英语会让你就自己喜欢的方向作简介呢难,要我说就完了   先想出这多了,下次再写,技术问题好多,有空把笔试题给大家看看,唉! 取自""、、、、、、、、、、、、、、、、、、、、、、题目为写算法生成随机4位数,规定每位数字不同. Solution: 有个隐含条件,即第一个数字不能为0.  以下是我初步的javascript解法: function rand4(){   var arr = new Array();   var index = 0;   var tempNum;   while(index<4){   tempNum = Math.round(Math.random()*9);   if(!(index==0 && tempNum==0)){    //hold point     if(arr[tempNum]== null){      arr[tempNum] = tempNum;      ++index;     }    }   }   var ret = 0;    for(var i in arr){    if (ret != 0){     ret *= 10;   }    ret += parseInt(i);   }   alert(ret);   return ret; }   我相信会编程的人都会写出这个算法. 基本上是很普通的.这个算法有个不快乐的地方就是hold point那块,成功率为100%(第一次),90%(第二次),80%(第三次),70%(第四次),越来越低,但是只要不低于50%,程序效率还不会打折扣. 以下是我的第二种写法,用空间换了点时间,用C++语言写的: 1. include 1. include using namespace std; class Rand4{   private:     int a[10];     int getNum(int index){       while(a[index]==-1){         ++index;         index %= 10;      }       int ret = a[index];        a[index] = -1;        return ret;      };     void init(){      for(int i=0;i<10;++i){         a[i] = i;       }      };   public:      int Next(){       init();       int ret = (rand()%10) *1000;       int index = 100;       int time = 3;       while(time>0){        ret += getNum((rand()%10))*index;        index /= 10;        --time;      }       return ret;      }; }; int main(int argc, char *argv[]) {  Rand4 r4;  cout<

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.