From 7ece2b07d9badf07c03e4e56b57b24dfc3a2bd67 Mon Sep 17 00:00:00 2001 From: pj89emcru <1767482154@qq.com> Date: Thu, 7 Nov 2024 20:43:26 +0800 Subject: [PATCH] ADD file via upload --- test two.cpp | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 test two.cpp 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