Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06._The_Most_Powerful_Word
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- decimal points = 0;
- while (true)
- {
- string line = Console.ReadLine();
- if (line == "End of words")
- {
- break;
- }
- for (int i = 0; i < line.Length; i++)
- {
- char currentLetter = line[i];
- points += currentLetter;
- if (line[0] == 'a' || line[0] == 'e' || line[0] == 'i' || line[0] == 'o' || line[0] == 'u' || line[0] == 'y'
- || line[0] == 'A' || line[0] == 'E' || line[0] == 'I' || line[0] == 'O' || line[0] == 'U' || line[0] == 'Y')
- {
- points = points * line.Length;
- }
- else
- {
- points += i;
- }
- }
- points = Math.Floor(points / line.Length);
- }
- Console.WriteLine(points);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement