围坐一起的题目,遇三退出
#include
using namespace std;
int main ()
{
int a[9999],i,b=0,n,c,z=0;
while(cin>>n)
{ b=0;c=n;
for(i=0;i
a[i]=i+1;
while(c--)
{
z=0;
for(i=0;i
if(a[i]!=0)
{
b++;z++;
if(b==3)
{
a[i]=0;
b=0;
}
}
if(z==1) break;
}
for(i=0;i
if(a[i]!=0)
cout<<a[i]<<endl;
}
return 0;
}
using namespace std;
int main ()
{
int a[9999],i,b=0,n,c,z=0;
while(cin>>n)
{ b=0;c=n;
for(i=0;i
a[i]=i+1;
while(c--)
{
z=0;
for(i=0;i
if(a[i]!=0)
{
b++;z++;
if(b==3)
{
a[i]=0;
b=0;
}
}
if(z==1) break;
}
for(i=0;i
if(a[i]!=0)
cout<<a[i]<<endl;
}
return 0;
}