level 6
#include
#include
#include
int main(){ int *square[]={0,0,0, 0,0,0, 0,0}; int check[]={0,0,0,0,0,0,0,0,0}; /*check[0]=0,check[1]=0,....check[8]=0*/ int x; int y; for(x=0;x<3;x++) { for(y=0;y<3;y++) { if(x==2&&y==2) break; do { srand((unsigned)time(NULL)); *(*(square+x)+y)==rand()%9; if(check[*(*(square+x)+y)]==1)/*检查随机数是不是已经存在了*/ continue; if(*(*(square+x)+y)=0)/*检查随机数是不是0*/ continue; check[*(*(square+x)+y)]=1; break; }while(1); } } getchar(); return 0; }运行不了....
2006年12月19日 01点12分