#include<stdio.h>
int j = 0;
int judge(int a[])
{
for (int i = 1; i < 10; i++)
{
if (a[0]!=a[i])
{
return 1;
}
}
return 0;
}
void put(int a[])
{
printf("第 %d 次 ", ++j);
for (int i = 0; i < 10; i++)
{
printf("%d ", a[i]);
}
printf("\n");
}
int main()
{
int a[10] = {10,2,8,22,16,4,10,6,14,20};
int sweet[10];
while (judge(a))
{
put(a);
for (int i = 0; i < 10; i++)
{
if (a[i] % 2 == 0)
sweet[i] = a[i] / 2;
else
sweet[i] = (a[i] + 1) / 2;
}
for (int i = 0; i < 10; i++)
a[(i+1)%10] = sweet[(i + 1) % 10] + sweet[i];
}
getchar();
return 0;
}