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;
- namespace _04.Vowels_Sum
- {
- class Program
- {
- static void Main(string[] args)
- {
- string letter = Console.ReadLine();
- int finalResult = 0;
- for (int i = 0; i < letter.Length; i++)
- {
- char eachLetter = letter[i];
- if (eachLetter == 'a')
- {
- finalResult += 1;
- }
- else if (eachLetter == 'e')
- {
- finalResult += 2;
- }
- else if (eachLetter == 'i')
- {
- finalResult += 3;
- }
- else if (eachLetter =='o')
- {
- finalResult += 4;
- }
- else if (eachLetter == 'u')
- {
- finalResult += 5;
- }
- }
- Console.WriteLine(finalResult);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement