Advertisement
Cassimus

metody

May 10th, 2025
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. internal class Program
  2. {
  3.     private static void Main(string[] args)
  4.     {
  5.         // int suma = Sumuj(5, 10 ,15);
  6.         // System.Console.WriteLine(suma);
  7.         // // .....
  8.         // System.Console.WriteLine(Sumuj(3,5,7));
  9.  
  10.         RysujProstokat(10,5);
  11.  
  12.         System.Console.WriteLine();
  13.  
  14.         RysujProstokat(10,5,"O");
  15.  
  16.     }
  17.  
  18.     static void RysujProstokat(int szerokosc, int wysokosc, string znak="#")
  19.     {
  20.         for (int wiersz = 0; wiersz<wysokosc; wiersz++)
  21.         {
  22.             for (int kolumna=0; kolumna<szerokosc; kolumna++ )
  23.             {
  24.                 Console.Write(znak);
  25.             }
  26.             Console.WriteLine();
  27.         }
  28.     }
  29.         static void RysujPustyProstokat(int szerokosc, int wysokosc, string znak="#")
  30.     {
  31.         for (int wiersz = 0; wiersz<wysokosc; wiersz++)
  32.         {
  33.             for (int kolumna=0; kolumna<szerokosc; kolumna++ )
  34.             {
  35.                 Console.Write(znak);
  36.             }
  37.             Console.WriteLine();
  38.         }
  39.     }
  40.  
  41.     static int Sumuj(int liczba1, int liczba2, int liczba3)
  42.     {
  43.         int suma = liczba1+ liczba2 + liczba3;
  44.  
  45.         return suma;
  46.     }
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement