微软实习生笔试题

时间:2024-08-08 19:21:22 资料大全 我要投稿
  • 相关推荐

微软实习生笔试题

// 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);

【微软实习生笔试题】相关文章:

微软广为流传的试题07-31

有趣的微软笔试题目08-05

面试指南:微软面试题集锦09-08

著名企业招聘典型试题精选-微软07-29

360笔试题目06-27

微软招聘心理智力测试题06-20

微软公司IBM社会招聘笔试题10-14

微软10道笔试面试题目08-24

世界五百强微软面试题09-21

微软公司笔试面试题经验分享10-19