2 つの別々のベクトルの文字列を比較し、最初のベクトル ファイルの内容を比較するアルゴリズムがあります: fileContent と fileContent1。一致する文字列がある場合、プログラムは最初のベクターの各行を出力し、一致するベクター 2 の行があるかどうかを報告する必要があります (この場合、"YES:" Vector1 行または "No" Vector1 行を出力します)。現時点で私の出力はこれであり、何が間違っているのか理解できないようです。ヒントやヘルプをいただければ幸いです。
現時点での私の出力:
NO:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:altimbankery
YES:loessoid
NO:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:loessoid
YES:stampede
YES:stampede
NO:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:stampede
YES:soger
YES:soger
YES:soger
NO:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:soger
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
NO:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:Plutarchical
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
NO:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:gigglesome
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
NO:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:unheated
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
NO:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:offendress
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
NO:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:syruper
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
NO:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:multispindle
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
NO:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:stinging
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
NO:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:Euspongia
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
NO:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:recluse
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
NO:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:continuum
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
NO:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:promotrix
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
NO:menyie
YES:menyie
YES:menyie
YES:menyie
YES:menyie
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
NO:perpetuator
YES:perpetuator
YES:perpetuator
YES:perpetuator
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
YES:hornblower
NO:hornblower
YES:hornblower
YES:hornblower
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
YES:kurung
NO:kurung
YES:kurung
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
YES:inductionally
NO:inductionally
file1 の内容:
unheated
rheometer
daemonurgy
maltase
morrowless
Plutarchical
czarism
missable
loessoid
siphonozooid
saltimbankery
unreduced
loglike
stampede
clickless
soger
gigglesome
vila
file2 の内容:
saltimbankery
loessoid
stampede
soger
Plutarchical
gigglesome
unheated
offendress
syruper
multispindle
stinging
Euspongia
recluse
continuum
promotrix
menyie
perpetuator
hornblower
kurung
inductionally
アルゴリズム:
if(algo_speed == "slow")
{
i = 0;
while(getline(ifs1, line))
{
fileContent1.push_back(line);
fileContent.push_back(line);
}
for(size_t i = 0; i < fileContent1.size() ; i++)
{
for(size_t j = 0; j < fileContent.size() ; j++)
{
size_t found = fileContent[i].find(fileContent1[j]);
if(found) {
cout << "YES:" << fileContent.at(i) << endl;
} else {
cout << "NO:" << fileContent.at(i) << endl;
}
//sort(fileContent1.begin(), fileContent1.end());
}
}
}