Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- class Program
- {
- static void Main(string[] args)
- {
- ArrayList lista = new ArrayList();
- int wynik = 0;
- string tekst = Console.ReadLine();
- string[] split = tekst.Split(' ');
- int poszukiwana = int.Parse(split[0]);
- int ileLiczb = int.Parse(split[1]);
- for (int j = 0; j < ileLiczb; j++)
- {
- int liczba = int.Parse(split[j + 2]);
- lista.Add(liczba);
- }
- foreach (int liczba in lista)
- {
- if (liczba == poszukiwana)
- {
- wynik++;
- }
- }
- Console.WriteLine(wynik);
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment