import java.util.*;
public class TEST
{
public static void main(String[]args)
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int a[]=new int [n];
for( int i=0;i<a.length;i++)
{
a[i]=i+1;
}
int number=a.length;
int count=0;
while(number>0)
{
for(int i=0;i<a.length;i++)
{
if(a[i]!=-1)
{
count++;
}
if(count==3)
{ count=0;
a[i]=-1;
number--;
}
if(number==0)
{
System.out.println(a[i]);
}
}
}
}
}
我实在想不出为什么输入6,会打出6个-1? 输入3为什么打出2个-1?还有就是eclipse是怎么调试debug的我双击代码左边后点上面的debug按钮没反应
幕布斯3464591