Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. static void CountLetter(string[] diary)
  2.         {
  3.             int maxCount = 0;
  4.             int counter = 0;
  5.  
  6.             for (int i = 0; i < diary.Length; i++)
  7.             {
  8.                 foreach (char ch in diary[i])
  9.                 {
  10.                     if (ch=='e')
  11.                     {
  12.                         counter++;
  13.                         maxCount = counter;
  14.                     }
  15.                 }
  16.                 Console.WriteLine("За {0}-ия ден, буквичката се среща {1} пъти.",(i+1),maxCount);
  17.             }
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement