Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace VowelSum
- {
- class Program
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine();
- int len =text.Length;
- double sum = 0;
- for (int i = 0; i < len; i++)
- {
- char letter = text[i];
- if(letter=='a')
- {
- sum += 1;
- }
- else if(letter=='e')
- {
- sum += 2;
- }
- else if(letter=='i')
- {
- sum += 3;
- }
- else if(letter =='o')
- {
- sum += 4;
- }
- else if(letter== 'u')
- {
- sum += 5;
- }
- }
- Console.WriteLine(sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement