Advertisement
finySTAR

2.Feladat megoldas

Mar 24th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.36 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. using System.IO;
  7.  
  8. namespace foci
  9. {
  10.     class Program
  11.     {
  12.  
  13.         static void Main(string[] args)
  14.         {
  15.             Console.WriteLine("1.Feladat");
  16.             StreamReader olvas = new StreamReader(@"C:\Users\finyw\Desktop\Erettsegi practice\e_infoforras_07okt_fl\Forrasok\4_Foci\meccs.txt", Encoding.Default);
  17.             List<string> meccsek = new List<string>();
  18.             while (!olvas.EndOfStream)
  19.             {
  20.                 meccsek.Add(olvas.ReadLine());
  21.  
  22.             }
  23.             Console.WriteLine("2.Feladat");
  24.             Console.Write("Adj meg egy fordulΓ³t: ");
  25.             string forduloszam = Console.ReadLine();
  26.             for (int i = 0; i < meccsek.Count; i++)
  27.             {
  28.                 if (forduloszam=="1")
  29.                 {
  30.                     if (meccsek[i].Substring(0, 1) == "1")
  31.                     {
  32.                         Console.WriteLine(meccsek[i]);
  33.                     }
  34.  
  35.                 }
  36.                 else if(forduloszam=="2")
  37.                 {
  38.                     if (meccsek[i].Substring(0,1)=="2")
  39.                     {
  40.                         Console.WriteLine(meccsek[i]);
  41.                     }
  42.                 }
  43.                 else if(forduloszam=="3")
  44.                 {
  45.                     if (meccsek[i].Substring(0,1)=="3")
  46.                     {
  47.                         Console.WriteLine(meccsek[i]);
  48.                     }
  49.                 }
  50.                 else if (forduloszam == "4")
  51.                 {
  52.                     if (meccsek[i].Substring(0, 1) == "4")
  53.                     {
  54.                         Console.WriteLine(meccsek[i]);
  55.                     }
  56.                 }
  57.                 else if (forduloszam == "5")
  58.                 {
  59.                     if (meccsek[i].Substring(0, 1) == "5")
  60.                     {
  61.                         Console.WriteLine(meccsek[i]);
  62.                     }
  63.                 }
  64.                 else if (forduloszam == "6")
  65.                 {
  66.                     if (meccsek[i].Substring(0, 1) == "6")
  67.                     {
  68.                         Console.WriteLine(meccsek[i]);
  69.                     }
  70.                 }
  71.                 else if (forduloszam == "7")
  72.                 {
  73.                     if (meccsek[i].Substring(0, 1) == "7")
  74.                     {
  75.                         Console.WriteLine(meccsek[i]);
  76.                     }
  77.                 }
  78.                 else if (forduloszam == "8")
  79.                 {
  80.                     if (meccsek[i].Substring(0, 1) == "8")
  81.                     {
  82.                         Console.WriteLine(meccsek[i]);
  83.                     }
  84.                 }
  85.                 else if (forduloszam == "9")
  86.                 {
  87.                     if (meccsek[i].Substring(0, 1) == "9")
  88.                     {
  89.                         Console.WriteLine(meccsek[i]);
  90.                     }
  91.                 }
  92.                 else if (forduloszam == "10")
  93.                 {
  94.                     if (meccsek[i].Substring(0, 1) == "10")
  95.                     {
  96.                         Console.WriteLine(meccsek[i]);
  97.                     }
  98.                 }
  99.                 else if (forduloszam == "11")
  100.                 {
  101.                     if (meccsek[i].Substring(0, 1) == "11")
  102.                     {
  103.                         Console.WriteLine(meccsek[i]);
  104.                     }
  105.                 }
  106.                 else if (forduloszam == "12")
  107.                 {
  108.                     if (meccsek[i].Substring(0, 1) == "12")
  109.                     {
  110.                         Console.WriteLine(meccsek[i]);
  111.                     }
  112.                 }
  113.                 else if (forduloszam == "13")
  114.                 {
  115.                     if (meccsek[i].Substring(0, 1) == "13")
  116.                     {
  117.                         Console.WriteLine(meccsek[i]);
  118.                     }
  119.                 }
  120.                 else if (forduloszam == "14")
  121.                 {
  122.                     if (meccsek[i].Substring(0, 1) == "14")
  123.                     {
  124.                         Console.WriteLine(meccsek[i]);
  125.                     }
  126.                 }
  127.                 else
  128.                 {
  129.  
  130.                 }
  131.                 Console.WriteLine("3.Feladat");
  132.  
  133.             }
  134.             Console.ReadLine();
  135.         }
  136.     }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement