Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace foci
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("1.Feladat");
- StreamReader olvas = new StreamReader(@"C:\Users\finyw\Desktop\Erettsegi practice\e_infoforras_07okt_fl\Forrasok\4_Foci\meccs.txt", Encoding.Default);
- List<string> meccsek = new List<string>();
- while (!olvas.EndOfStream)
- {
- meccsek.Add(olvas.ReadLine());
- }
- Console.WriteLine("2.Feladat");
- Console.Write("Adj meg egy fordulΓ³t: ");
- string forduloszam = Console.ReadLine();
- for (int i = 0; i < meccsek.Count; i++)
- {
- if (forduloszam=="1")
- {
- if (meccsek[i].Substring(0, 1) == "1")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if(forduloszam=="2")
- {
- if (meccsek[i].Substring(0,1)=="2")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if(forduloszam=="3")
- {
- if (meccsek[i].Substring(0,1)=="3")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "4")
- {
- if (meccsek[i].Substring(0, 1) == "4")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "5")
- {
- if (meccsek[i].Substring(0, 1) == "5")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "6")
- {
- if (meccsek[i].Substring(0, 1) == "6")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "7")
- {
- if (meccsek[i].Substring(0, 1) == "7")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "8")
- {
- if (meccsek[i].Substring(0, 1) == "8")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "9")
- {
- if (meccsek[i].Substring(0, 1) == "9")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "10")
- {
- if (meccsek[i].Substring(0, 1) == "10")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "11")
- {
- if (meccsek[i].Substring(0, 1) == "11")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "12")
- {
- if (meccsek[i].Substring(0, 1) == "12")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "13")
- {
- if (meccsek[i].Substring(0, 1) == "13")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else if (forduloszam == "14")
- {
- if (meccsek[i].Substring(0, 1) == "14")
- {
- Console.WriteLine(meccsek[i]);
- }
- }
- else
- {
- }
- Console.WriteLine("3.Feladat");
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement