Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp11
  8. {
  9.    public class dane
  10.     {
  11.         int[,] tab = new int[1, 9];
  12.  
  13.      
  14.  
  15.         public void zapelnij()// inicalizajca wartosci
  16.         {
  17.             for(int i =0;i<1;i++)
  18.             {
  19.                 for(int j =0;j<9;j++)
  20.                 {
  21.                     tab[i, j] = i + j;
  22.                 }
  23.             }
  24.         }
  25.         public int max_tablicy()
  26.         {
  27.             int max = 0;
  28.  
  29.             for (int i = 0; i < 1; i++)
  30.             {
  31.                 for (int j = 0; j < 9; j++)
  32.                 {
  33.                     if(tab[i,j]>max)
  34.                     {
  35.                         max = tab[i, j];
  36.                     }
  37.                 }
  38.             }
  39.             return max;
  40.         }
  41.        
  42.     }
  43.     class Program
  44.     {
  45.         static void Main(string[] args)
  46.         {
  47.             dane nowa = new dane();
  48.             nowa.zapelnij();
  49.             Console.WriteLine(" " + nowa.max_tablicy());
  50.             Console.ReadKey();
  51.  
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement