int count=10,step=3;
int array[10];
int temp_const;
int temp=0;
for(int i=1;i<step;i++){
temp_const=(i*count)/step;
if(temp_const!=array[temp-1]){
array[temp]=temp_const;
temp++;
}
}
int count=10,step=3;
int array[10];
int temp_const;
int temp=0;
for(int i=1;i<count;i++){
temp_const=i/step;
if(temp_const!=array[temp-1]){
array[temp]=temp_const;
temp++;
}
}
因为楼主没说很清楚,不知道我理解的对不.
是不是你的意思就是想要上面代码中 array时面的数据库