Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. bool itemsMatch(vector<Nutrient> nut, vector<Ingredient> ing) {
  2. int matchCount = 0;
  3.  
  4. for (int i = 0; i < nut.size(); i++) {
  5. for (int j = 0; j < ing.size(); j++) {
  6. if (nut[i].name == ing[j].name) {
  7. cout << nut[i].name << " matched " << ing[j].name << endl;
  8. cout << "n";
  9. }
  10. }
  11. return true;
  12. }
  13.  
  14. struct Nutrient {
  15. string name, units;
  16. double amount, calories;
  17. };
  18.  
  19. struct Ingredient {
  20. string name, units;
  21. double amount;
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement