diff --git a/test two.cpp b/test two.cpp new file mode 100644 index 0000000..af95bc3 --- /dev/null +++ b/test two.cpp @@ -0,0 +1,96 @@ +#include +#include +#include +int main() +{ + srand(time(NULL)); + int i,j,k,p=0,l; + int temp1,temp2,temp; + int a[9][9]={0},t1[9]={1,2,3,4,5,6,7,8,9},t2[3]; + for(i=0;i<9;i++) + { + if(i%3==0) + { + for(j=0;j<10;j++) + { + temp1=rand()%9; + temp2=rand()%9; + if(temp1!=temp2) + { + temp=t1[temp1]; + t1[temp1]=t1[temp2]; + t1[temp2]=temp; + } + } + l=0; + } + for(j=0;j<3;j++) + { + t2[j]=rand()%9; + for(k=0;k