Advertisement
onomato90

Zad.1 Teksty z tablicy

Jun 25th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 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 zadanie_z_tablica
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             System.Console.WriteLine("Program wypelniajacy tablice podanym tekstem.");
  14.  
  15.             string[] text = new string[5];
  16.  
  17.             int tablica = text.Length;
  18.  
  19.             for (int i = 0; i < tablica; i++)
  20.             {
  21.                 Console.WriteLine();
  22.                 System.Console.WriteLine("Podaj tekst: ");
  23.                 string tekscik;
  24.                 tekscik = Console.ReadLine();
  25.                 text[i] = tekscik;
  26.             }
  27.  
  28.             Console.WriteLine();
  29.             System.Console.WriteLine("Wpisane teksty to:");
  30.             Console.WriteLine();
  31.  
  32.             for (int j = 0; j < tablica; j++)
  33.             {
  34.                 Console.WriteLine(j+1 + ". " + text[j]);
  35.                 Console.WriteLine();
  36.             }
  37.                 System.Console.ReadKey();
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement