Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace NameGame
- {
- class Program
- {
- static void Main(string[] args)
- {
- string name = Console.ReadLine();
- string winner = "";
- int points = 0;
- while (name != "Stop")
- {
- int sum = 0;
- for (int i = 0; i < name.Length; i++)
- {
- int num = int.Parse(Console.ReadLine());
- int z = name[i];
- if (num == z)
- {
- sum += 10;
- }
- else
- {
- sum += 2;
- }
- }
- if (sum >= points)
- {
- winner = name;
- points = sum;
- }
- name = Console.ReadLine();
- }
- Console.WriteLine($"The winner is {winner} with {points} points!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement