anizko

02. Vowels Count

Jul 2nd, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.81 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _02._Vowels_Count
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string singalString = Console.ReadLine().ToLower();
  10.  
  11.             double vowels = FinedVowels(singalString.Length, singalString);
  12.  
  13.             Console.WriteLine(vowels);
  14.         }
  15.  
  16.         static double FinedVowels(double singalStringLength, string singalString)
  17.         {
  18.             double vowels = 0;
  19.             for (int i=0; i< singalStringLength; i++)
  20.             {
  21.                 char symbol = singalString[i];
  22.  
  23.                 if(symbol=='a' || symbol == 'e' || symbol == 'u' ||
  24.                     symbol == 'o' || symbol == 'i')
  25.                 {
  26.                     vowels++;
  27.                 }
  28.             }
  29.             return vowels;
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment