亚洲国产日韩欧美在线a乱码,国产精品路线1路线2路线,亚洲视频一区,精品国产自,www狠狠,国产情侣激情在线视频免费看,亚洲成年网站在线观看

微軟實(shí)習(xí)生筆試題

時(shí)間:2022-12-09 17:23:29 筆試題目 我要投稿
  • 相關(guān)推薦

微軟實(shí)習(xí)生筆試題

// test.cpp : 定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。
//

微軟實(shí)習(xí)生筆試題

#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] == '*')
      for (;chA[j+1]!=chB[i+1];j++)
      {
       if (chA[j+1] == '\0')
        break;
      }

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

【微軟實(shí)習(xí)生筆試題】相關(guān)文章:

微軟筆試題08-13

微軟的筆試試題07-31

微軟筆試題及分析07-31

2015微軟筆試題07-31

2011微軟筆試題07-20

詳細(xì)的微軟試題及解答08-08

微軟筆試題目03-16

微軟面試題07-25

微軟面試題目07-31

微軟面試試題大家談07-31