Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Balls
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- string color;
- int Points = 0;
- int whitePoints = 0;
- int redPoints = 0;
- int orangePoints = 0;
- int yellowPoints = 0;
- int blackDividing = 0;
- int otherColors = 0;
- for (int i = 1; i <= N; i++)
- {
- color = Console.ReadLine().ToLower();
- if (color == "white")
- {
- Points += 20;
- whitePoints++;
- }
- else if (color == "red")
- {
- Points += 5;
- redPoints++;
- }
- else if (color == "orange")
- {
- Points += 10;
- orangePoints++;
- }
- else if (color == "yellow")
- {
- Points += 15;
- yellowPoints++;
- }
- else if (color == "black")
- {
- Points /= 2;
- blackDividing++;
- }
- else if (color != "white")
- {
- otherColors++;
- }
- }
- Console.WriteLine($"Total points: {Points}");
- Console.WriteLine($"Points from red balls: {redPoints}");
- Console.WriteLine($"Points from orange balls: {orangePoints}");
- Console.WriteLine($"Points from yellow balls: {yellowPoints}");
- Console.WriteLine($"Points from white balls: {whitePoints}");
- Console.WriteLine($"Other colors picked: {otherColors}");
- Console.WriteLine($"Divides from black balls: {blackDividing}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement