版本比较
数数
正文
增加 1 行删除 1 行
10 行未改动11121314151516171819202122232425263 行未改动10 行未改动 shuffle(a+1,a+n*n+1,Rand); for(int i=1; i<=n; i++) { for(int j=1; j<=n; j++)b[i][j]=a[++len]; } auto start = chrono::steady_clock::now(); for(int i=1; i<=n; i++) { for(int j=1; j<=n; j++) { cout<<b[i][j]<<' '; if(b[i][j]<10)cout<<' '; } cout<<endl; } auto start = chrono::steady_clock::now(); cin>>n; auto now = chrono::steady_clock::now(); chrono::duration<double> elapsed = now - start; cout<<elapsed.count();3 行未改动