Advertisement
homeworkhelp111

sentence

Feb 5th, 2022
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <cctype>
  5.  
  6. using namespace std;
  7.  
  8. void ReadSentences(vector<string>& sentence1Words, vector<string>& sentence2Words, int wordCount) {
  9.     for (int i = 0; i < wordCount; i++) {
  10.         cin>>sentence1Words[i];
  11.     }
  12.     for (int i = 0; i < wordCount; i++) {
  13.         cin>>sentence2Words[i];
  14.     }
  15. }
  16. int main() {
  17.     vector<string> firstSentence(20);
  18.     vector<string> secondSentence(20);
  19.  
  20.     int wordCount;
  21.     int i;
  22.  
  23.     cin >> wordCount;
  24.  
  25.     ReadSentences(firstSentence, secondSentence, wordCount);
  26.  
  27.     for (i = 0; i < wordCount; i++) {
  28.         if (firstSentence[i] != secondSentence[i]) {
  29.             cout << firstSentence[i] << " " << secondSentence[i] << endl;
  30.         }
  31.     }
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement