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 Footgolf
- {
- class Program
- {
- static List<Adatok> AdatokL;
- static void Main(string[] args)
- {
- Beolvas();
- F03();
- F04();
- FXX();
- Console.ReadKey();
- }
- private static void FXX()
- {
- }
- private static void F04()
- {
- double nokSzama = 0;
- for (int i = 0; i < AdatokL.Count; i++)
- {
- if (AdatokL[i].kategoria == "Noi")
- {
- nokSzama++;
- }
- }
- int w = (int)nokSzama;
- int h = AdatokL.Count;
- decimal g = decimal.Divide(w, h);
- Console.Write("4.feladat: A női versenyzők aránya: {0:P2}",g);
- }
- private static void F03()
- {
- Console.Write($"3.feladat: Versenyzők száma: {AdatokL.Count}");
- Console.WriteLine();
- }
- private static void Beolvas()
- {
- AdatokL = new List<Adatok>();
- var sr = new StreamReader("fob2016.txt", Encoding.UTF8);
- while (!sr.EndOfStream)
- {
- AdatokL.Add(new Adatok(sr.ReadLine()));
- }
- sr.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement