Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int wordcompare(string InputWord, string AnswerWord) {
- // ? if : else
- int size = (InputWord.size() < AnswerWord.size()) ? InputWord.size() : AnswerWord.size();
- int DifferenceBetweenWords = 0;
- for(int i= 0; i < size; ++i){
- if(InputWord[i] == AnswerWord[i]){
- ++DifferenceBetweenWords;
- }
- }
- return DifferenceBetweenWords;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement