你的程序好像差距很大,弄一个一维的结构体数组或者链表吧。
struct right_rs{
unsigned int r1;
unsigned int r2;
unsigned int r3;
};
int GetRightRs(const unsigned int r1,const unsigned int r2,const unsigned int r3,struct right_rs *rs)
{
// 判断
// 给rs赋值。
return 0;
}
int test()
{
struct right_rs rs_array[MAX_SIZE];
unsigned int i,j,k,count = 0;
for(i = 0; i < MAX_R1; i ++){
for(j = 0; j < MAX_R2; j ++){
for(k = 0; j < MAX_R3; j ++){
if(GetRightRs(i,j,k,rs_array + count) == 0){
count += 1;
}
}
}
}
}
|