好难啊......
/*生成齿轮*/
beg = 0; changed = 1;
while ( changed )
{ changed = 0; end = m;
for (i = beg; i < end; i++)
{
for (j = 0; j <= i; j++)
{
sum = size[i] * size[j];
if ( sum < 30001 && cols[sum] == 0 )
{
changed = 1;
cols[sum] = 1;
size[m++] = sum;
}
}
}
beg = end;
}
[此贴子已经被作者于2006-12-8 16:16:05编辑过]