Guest User

Untitled

a guest
Mar 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. for (int i = 0; i< dfood.Count; i++)
  2. {
  3. for(int j = 0; j < temp.Count; j++)
  4. {
  5. if(temp[j].id == dfood[i])
  6. {
  7. food temp2 = temp[j];
  8. temp2 = temp[j];
  9. int c = temp2.cal;
  10. temp2.setCalory((int)(((double)c / 100) * masses[i]));
  11.  
  12. result.Add(temp2);
  13. result[result.Count-1].getInfo();//выводит верную инфу 100%
  14. }
  15. }
  16. }
  17. foreach (food cal in resulst)
  18. {
  19. cal.getInfo(); // не верная инфа
  20. }
Add Comment
Please, Sign In to add comment