Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std.random;
- import std.stdio;
- import std.array;
- import std.math;
- void main()
- {
- int i,j;
- const int row = 5000;
- const int col = 5000;
- // создаём матрицу
- int[][] testArray = uninitializedArray!(int[][])(row,col);
- // заполняем рандомом 100 - 1000
- for (i=0; i<row; ++i) {
- for (j=0; j<col; ++j) {
- testArray[i][j] = cast(int)uniform(100, 1000);
- }
- }
- // делим имеющиеся на рандом 2 - 10 и округляем
- for (i=0; i<row; ++i) {
- for (j=0; j<col; ++j) {
- testArray[i][j] = cast(int)round(testArray[i][j]/uniform(2, 10));
- }
- }
- }
Add Comment
Please, Sign In to add comment