Facebook
From asd, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 235
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.         static int Suma(int[] dane)
  12.         {
  13.             int suma = 0;
  14.  
  15.             for (int i = 0; i < dane.Length; i++)
  16.             { suma += dane[i];
  17.             }
  18.  
  19.             return suma;
  20.         }
  21.         static void Main(string[] args)
  22.         {
  23.             //int[] dane = new int[5];
  24.             //dane[0] = 12;
  25.             //dane[1] = 34;
  26.             //dane[2] = -56;
  27.             //dane[3] = -78;
  28.             //dane[4] = 90;
  29.  
  30.             //foreach (var x in dane)
  31.             //{
  32.             //    Console.WriteLine(x);
  33.             //}
  34.  
  35.             //for (int i = 0; i < dane.Length; i++)
  36.             //{
  37.             //    Console.WriteLine(dane[i]);
  38.  
  39.             //}
  40.             //Console.WriteLine("Suma danych to: " + Suma(dane));
  41.             //Console.ReadKey();
  42.  
  43.             //int[,] macierz = new int[3, 3];
  44.  
  45.             //foreach (var x in macierz)
  46.             //{
  47.             //    Console.SetCursorPosition(x % 3, x / 3);
  48.             //    Console.WriteLine(x + "  ");
  49.             //}
  50.  
  51.  
  52.  
  53.             uczen uczen1;
  54.             Console.WriteLine("Podaj dane:");
  55.  
  56.             Console.Write("Imie      :");
  57.             uczen1.imie = Console.ReadLine();
  58.  
  59.             Console.Write("Nazwisko  :");
  60.             uczen1.nazwisko = Console.ReadLine();
  61.  
  62.             Console.Write("E-mail    :");
  63.             uczen1.email = Console.ReadLine();
  64.  
  65.             Console.Write("Wiek      :");
  66.             uczen1.wiek = int.Parse(Console.ReadLine());
  67.  
  68.             Console.WriteLine(uczen1.imie + "  " + uczen1.nazwisko);
  69.  
  70.             uczen[] klasa1m = new uczen[25];
  71.  
  72.             klasa1m[4].imie = "";
  73.  
  74.             Console.ReadKey();
  75.  
  76.         }
  77.      
  78.     }
  79. }
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86. using System;
  87. using System.Collections.Generic;
  88. using System.Linq;
  89. using System.Text;
  90. using System.Threading.Tasks;
  91.  
  92. namespace ConsoleApp1
  93. {
  94.     struct uczen
  95.     {
  96.        public string imie, nazwisko, email;
  97.         public int wiek;
  98.     }
  99. }
  100.