Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq.Expressions;
- namespace Add_Bags
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int totalPoints = 0;
- int red = 0;
- int orange = 0;
- int yellow = 0;
- int white = 0;
- int black = 0;
- int others = 0;
- for (int i = totalPoints; i < n; i++)
- {
- string colours = Console.ReadLine();
- switch (colours)
- {
- case "red":
- totalPoints += 5;
- red++;
- break;
- case "orange":
- totalPoints += 10;
- orange++;
- break;
- case "yellow":
- yellow++;
- break;
- case "white":
- totalPoints += 20;
- white++;
- break;
- case "black":
- totalPoints /= 2;
- black++;
- break;
- default:
- others++;
- break;
- }
- }
- Console.WriteLine($"Total points: {totalPoints}");
- Console.WriteLine($"Red balls: {red}");
- Console.WriteLine($"Orange balls: {orange}");
- Console.WriteLine($"Yellow balls: {yellow}");
- Console.WriteLine($"White balls: {white}");
- Console.WriteLine($"Other colors picked: {others}");
- Console.WriteLine($"Divides from black balls: {black}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement