Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace orai1202
- {
- class Program
- {
- static void tombfeltolt(int[,] tomb)
- {
- for (int j = 0; j < 10; j++ )
- {
- for (int i = 0; i < 10; i++)
- {
- tomb[j, i] = (j+1)* (i + 1);
- }
- }
- }
- static void tombfeltolt2(int[,] tomb, Random vel)
- {
- for (int j = 0; j < 10; j++ )
- {
- for (int i = 0; i < 10; i++)
- {
- tomb[j, i] = vel.Next(10, 100);
- }
- }
- }
- static void Main(string[] args)
- {
- int[,] tomb = new int[10, 10];
- tombfeltolt(tomb);
- for (int i = 0; i < 10; i++ )
- {
- for (int j = 0; j < 10; j++ )
- {
- Console.Write("{0,3} ", tomb[j, i]);
- }
- Console.WriteLine();
- }
- Console.WriteLine();
- Random vel = new Random();
- tombfeltolt2(tomb, vel);
- for (int i = 0; i < 10; i++ )
- {
- for (int j = 0; j < 10; j++)
- {
- if(tomb[j, i] % 2 == 0)
- {
- tomb[j, i] = 0;
- }
- Console.Write("{0,3} ", tomb[j, i]);
- }
- Console.WriteLine();
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement