int cnt1 = tea.size(), cnt2 = ass.size(), cnt3 = sta.size(), cnt4 = tst.size();
int sum = num();
int tt = 0, yy = 0;
for (auto i : tea)
if (i.sex == "男")
++tt;

i:tea是什么意思?求详细的解释,谢谢大佬!
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- threenewbee 2019-04-26 00:25关注
for (auto i : tea)
这应该是C++ 14的语法,自动迭代器,遍历tea,每次遍历的那个元素就是i
i本身也是 iterative (迭代变量)的缩写。本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报