#include<stdio.h>
#define num 16
void process(int *p,int *p2)
{
int i,m,k;
m=3;k=3;
while(m>2)
{
m=0;
for(i=0;i<=num-1;i++)
if(*(p+i)!=0)
{
k++;
if(k%3==0)
*(p+i)=0;
}
for(i=0;i<=num-1;i++)
if(*(p+i)!=0) m++;
}
for(i=0;i<=num-1;i++)
if(*(p+i)!=0) { *p2=i;p2++;}
}
void main()
{
int a[num],i,*p1,*p2,b[2];
for(i=0;i<=num-1;i++)
a[i]=1;
p1=a;p2=b;
process(p1,p2);
printf("the result is :
");
for(i=0;i<=num-1;i++)
printf("%2d",a[i]);
printf("\n theremained num is : num.%d and num.%3d",b[0],b[1]);
}