Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace VowelsSum
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- int sum = 0;
- for (int i = 0; i < input.Length; i++)
- {
- char letter = input[i];
- {
- switch (letter)
- {
- 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);
- }
- }
- }
Add Comment
Please, Sign In to add comment