日期:2014-05-20 浏览次数:20628 次
public static void main(String[] args)
{
final int NUM = 21;
int number =0;
int kongping =0;
for (int i = 0; i < 21; i++,number++,kongping++)
{
if (kongping == 3)
{
number = number+1;
kongping = 1;
}
if(number == NUM)
{
System.out.println(i);
break;
}
}
}
public static void main(String[] args)
{
final int NUM = 21;
int number =0;
int kongping =0;
for (int i = 0; i < 21; i++,number++,kongping++)
{
if(number == NUM)
{
System.out.println(i);
break;
}
if (kongping == 3)
{
number = number+1;
kongping = 1;
}
}
}