目前本站已有 十几万 份求职资料啦!


微软实习生2017笔试题目最后一题

05-13 15:26:23 来源:http://www.qz26.com 笔试题目   阅读:8919
导读:虽然咱被微软给鄙视了,但是回来还是写了写最后一题的程序。当时只有半个小时,可我回来晃晃悠悠地写也写了起码多于1个小时……看来咱跟微软的要求差距还是蛮大的啊……哎……怨念…… // test.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#define BUFMAX 100//Find frequency of words of file-B.txt in file-A.txtvoid Find (string &filenameA, string &filenameB){ string tempA, tempB; char chA[BUFMAX], chB[BUFMAX]; int cnt = 0, match = 0; if ( (filenameA.length()==0) || (filenameB.length()==0) ) {
微软实习生2017笔试题目最后一题,标签:银行笔试题目,企业笔试题目,http://www.qz26.com

虽然咱被微软给鄙视了,但是回来还是写了写最后一题的程序。当时只有半个小时,可我回来晃晃悠悠地写也写了起码多于1个小时……看来咱跟微软的要求差距还是蛮大的啊……哎……怨念……

 

// test.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"

#define BUFMAX 100

//Find frequency of words of file-B.txt in file-A.txt
void Find (string &filenameA, string &filenameB)
{
 string tempA, tempB;
 char chA[BUFMAX], chB[BUFMAX];
 int cnt = 0, match = 0;
 
 if ( (filenameA.length()==0) || (filenameB.length()==0) )
 {
  cout << "Invalid input filename!" << endl;
  return ;
 }
 
 ifstream infileA ( filenameA.c_str() );
 ifstream infileB ( filenameB.c_str() );

 if ( infileA.fail() || infileB.fail() )
 {
  cout << "Cannot open input files!" << endl;
  return ;
 }

 while ( getline(infileB, tempB) )
 {
  memcpy ( chB, tempB.c_str(), tempB.length()+1 );
  cnt = 0;

  infileA.seekg (0, ios::beg);

  while ( !infileA.eof() )
  {
   infileA >> tempA;
   
   if (tempA == tempB)
    cnt++;
   else
   {
    memcpy (chA, tempA.c_str(), tempA.length()+1);

    match = 1;
    
    for (int i=0, j=0; ; i++, j++)
    {

     if (!chB[i] && !chA[j])
      break;

     else if ( !( chB[i] && chA[j] ))
     {
      match = 0;
      break;
     }

 

     if (chB[i] == '?')
      continue;

     else if (chB[i] == '*')
     

[1] [2]  下一页


Tag:笔试题目银行笔试题目,企业笔试题目求职笔试面试 - 笔试题目
【字号: 】 【打印】 【关闭
《微软实习生2017笔试题目最后一题》相关文章
最新更新
推荐热门
联系我们 | 网站地图 | 财务资料 | 范文大全 | 求职简历 | 财会考试 | 成功励志
Copyright 二六求职资料网 All Right Reserved.
1 2 3 4 5 6 7 8 9 10