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 exam2018
- {
- class Program
- {
- static void Main(string[] args)
- {
- int balls = int.Parse(Console.ReadLine());
- int score = 0;
- int red = 0;
- int orange = 0;
- int yellow = 0;
- int white = 0;
- int black = 0;
- int different = 0;
- int divides = 0;
- for (int i = 0; i < balls; i++)
- {
- string colour = Console.ReadLine();
- if (colour == "red")
- {
- score += 5;
- red+=1;
- }else if (colour == "orange")
- {
- score += 10;
- orange+=1;
- }else if (colour == "yellow")
- {
- score += 15;
- yellow+=1;
- }else if (colour == "white")
- {
- score += 20;
- white+=1;
- }else if (colour == "black")
- {
- score /= 2;
- divides += 1;
- }
- else
- {
- score += 0;
- different += 1 ;
- }
- }
- Console.WriteLine($"Total points: {score}");
- Console.WriteLine($"Points from red balls: {red}");
- Console.WriteLine($"Points from orange balls: {orange}");
- Console.WriteLine($"Points from yellow balls: {yellow}");
- Console.WriteLine($"Points from white balls: {white}");
- Console.WriteLine($"Other colors picked: {different}");
- Console.WriteLine($"Divides from black balls: {divides}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement