首页 > 代码库 > 利用+=n连续保存或者输出n个数

利用+=n连续保存或者输出n个数

for (int k = 0; k < list.size(); k += 2) {
if (((k + 1) % 2) != 0) {


m1 = (MealEntity) list.get(k);
%>
<tr>
<td>
<a href=http://www.mamicode.com/"MealServlet?type=findbyid&mid=">src=http://www.mamicode.com/"mealImg/.jpg" width="148"
height="126" border="0" /> </a>
</td>
<td>
<div>
<%=m1.getMealId()%>
:
<%=m1.getMealName()%>
<br />
<span style="text-decoration: line-through; color: gray;">原价:人民币<%=m1.getMealPrice()%>元</span>
<br />
现价:人民币
<%=m1.getMemberPrice()%>

</div>
<a href=http://www.mamicode.com/"MealServlet?type=findbyid&mid=">
<a href=http://www.mamicode.com/"ShoppingCartServlet?type=add&mid=">
</td>
<%
if (k == list.size() - 1) {
break;
}
if (k < list.size() - 1) {
m2 = (MealEntity) list.get(k + 1);
} else {
break;
}
}
%>
<td>
<a href=http://www.mamicode.com/"MealServlet?type=findbyid&mid=">src=http://www.mamicode.com/"mealImg/.jpg" width="148"
height="126" border="0" /> </a>
</td>
<td>
<div>
<%=m2.getMealId()%>
:
<%=m2.getMealName()%>
<br />
<span style="text-decoration: line-through; color: gray;">原价:人民币<%=m2.getMealPrice()%>元</span>
<br />
现价:人民币
<%=m2.getMemberPrice()%>

</div>
<a href=http://www.mamicode.com/"MealServlet?type=findbyid&mid=">
<a href=http://www.mamicode.com/"ShoppingCartServlet?type=add&mid=">
</td>