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 Vowels_Sum
- {
- class Program
- {
- static void Main(string[] args)
- {
- var word = Console.ReadLine();
- var sum = 0;
- for (int i = 0; i < word.Length; i++)
- {
- switch (word[i])
- {
- case 'a': sum += 1; break;
- case 'e': sum += 2; break;
- case 'i': sum += 3; break;
- case 'o': sum += 4; break;
- case 'u': sum += 5; break;
- }
- }
- Console.WriteLine(sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment