void Main()
{
IntegerBuffer buffer = new();
for (int i = 0; i < 10; i++)
{
buffer.AddInt(i);
}
}
public class IntegerBuffer
{
static int arraysize=6;
int top=0;
int[] arrInt = new int[arraysize];
public void AddInt(int num)
{
if (top > arraysize-1) top = 0;
arrInt[top] = num;
top++;
ShowBuffer();
}
void ShowBuffer()
{
foreach (int i in arrInt)
{
Console.Write(i);
}
Console.WriteLine();
}
}
//----------output---------------------------
000000
010000
012000
012300
012340
012345
612345
672345
678345
678945