for(int i=0;i<3;i++) { cost[i] = (int)(num/pen[0][i]);//这一行是什么意思啊,int用()括起来是定义后面是整形吗 if ((num%pen[0][i]!=0)) { cost[i]+=1; } cost[i]*=pen[1][i]; }
强制类型转换