Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.IO;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string path = @"d:\e4.txt";
- if (File.Exists(path))
- {
- StringBuilder input = new StringBuilder(File.ReadAllText(path));
- StringBuilder ech = new StringBuilder("эчпочмак");
- int[] count = new int[8];
- for (int i = 0; i < 8; i++)
- {
- for (int j = 0; j < input.Length; j++)
- {
- if (input[j] == ech[i])
- {
- count[i]++;
- }
- }
- }
- int min = count[0];
- for (int k = 0; k < 8; k++)
- {
- if (count[k] < min)
- min = count[k];
- }
- Console.WriteLine("Количество эчпочмаков:");
- Console.WriteLine(min);
- Console.ReadLine();
- }
- else Console.WriteLine("Файл не найден");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement