Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2.  
  3. namespace LoopLab
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string text = Console.ReadLine();
  10.  
  11.  
  12.             for (int i = 0; i < text.Length; i++)
  13.             {
  14.                 int sum = 0;
  15.                 char letter = text[i];
  16.  
  17.                 switch (letter)
  18.                 {
  19.                     case 'a':
  20.                         sum += 1;
  21.                         break;
  22.                     case 'e':
  23.                         sum += 2;
  24.                         break;
  25.                     case 'i':
  26.                         sum += 3;
  27.                         break;
  28.                     case 'o':
  29.                         sum += 4;
  30.                         break;
  31.                     case 'u':
  32.                         sum += 5;
  33.                         break;                                          
  34.                 }
  35.             }
  36.  
  37.  
  38.             Console.WriteLine(sum);
  39.        
  40.        
  41.         }  
  42.        
  43.     }
  44.    
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement