.


:




:

































 

 

 

 


DataGridView




. DataGridView . . : dataGridView1.Rows[2].Cells[7].Value = "*"; 7 .

: 15 15. . , Button, textBox.

. 3.1.

. 3.1.

 

.

 

private void button1_Click(object sender, EventArgs e)

{

dataGridView1.RowCount = 15; //

dataGridView1.ColumnCount = 15; //

int[,] a = new int[15,15]; //

int i,j;

//

Random rand = new Random();

for (i=0; i<15; i++)

for (j=0; j<15; j++)

a[i,j] = rand.Next(-100,100);

// dataGridView1

for (i=0; i<15; i++)

for (j=0; j<15; j++)

dataGridView1.Rows[i].Cells[j].Value = Convert.ToString(a[i,j]);

//

int m = int.MinValue;

for (i = 0; i < 15; i++)

if (a[i, 14 - i] > m) m = a[i, 14 - i];

//

textBox1.Text = Convert.ToString(m);

}

 

( ) ( ), . (), (/) . , Array foreach. .

1. . , , .

2. . , , .

3. . ( 1), .

4. . , .

5. , . .

6. , .

7. ( ) . , , .

8. n+1 ( n ) , .

9. (. ), .

10. , , .

11. , , .

12. . ( ), .

13. , .

14. , .

15. , , .

16. . , , , .

17. , .

18. . , 1, , ( , ).

19. ( ) , : .

20. , , .

21. , 2.

22. , , .

23. , , .

24. .

( ), .





:


: 2017-04-15; !; : 1591 |


:

:

, .
==> ...

1393 - | 1201 -


© 2015-2024 lektsii.org - -

: 0.011 .