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 _4_Balls
- {
- class Program
- {
- static void Main(string[] args)
- {
- int balls = int.Parse(Console.ReadLine());
- int points = 0;
- int redPoints = 0;
- int yellowPoints = 0;
- int orangePoints = 0;
- int whitePoints = 0;
- int blackPoints = 0;
- int otherPoints = 0;
- for (int i = 1; i <= balls; i++)
- {
- string color = Console.ReadLine();
- switch (color)
- {
- case "red":
- points += 5;
- redPoints++;
- break;
- case "orange":
- points += 10;
- orangePoints++;
- break;
- case "yellow":
- points += 15;
- yellowPoints++;
- break;
- case "white":
- points += 20;
- whitePoints++;
- break;
- case "black":
- points /= 2;
- blackPoints++;
- break;
- default:
- otherPoints++;
- break;
- }
- }
- Console.WriteLine("Total points: {0}", points);
- Console.WriteLine("Points from red balls: {0}", redPoints);
- Console.WriteLine("Points from orange balls: {0}", orangePoints);
- Console.WriteLine("Points from yellow balls: {0}", yellowPoints);
- Console.WriteLine("Points from white balls: {0}", whitePoints);
- Console.WriteLine("Other colors picked: {0}", otherPoints);
- Console.WriteLine("Divides from black balls: {0}", blackPoints);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement