Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _03.NamesGame
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int maxPoints = int.MinValue;
- string winnerWord = "";
- string name = Console.ReadLine();
- while (name != "END OF GAME")
- {
- int points = 0;
- char lastLetter = name[name.Length - 1];
- if (lastLetter == 'a')
- {
- points += 10;
- }
- else if (lastLetter == 'v')
- {
- points += 13;
- }
- if (name.Length >= 7)
- {
- points += 33;
- }
- else
- {
- points += 22;
- }
- if (points > maxPoints)
- {
- maxPoints = points;
- winnerWord = name;
- }
- name = Console.ReadLine();
- }
- Console.WriteLine($"Winner is name: {winnerWord}");
- Console.WriteLine($"Points: {maxPoints}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement