Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n = int.Parse(Console.ReadLine());
- int points = 0;
- int pointred = 0;
- int pointorange = 0;
- int pointyellow = 0;
- int pointwhite = 0;
- int pointblack = 0;
- int othercolors = 0;
- for (int i = 0; i < n; i++)
- {
- string color = Console.ReadLine();
- if(color == "red")
- {
- points = points + 5;
- pointred++;
- }
- else if (color == "orange")
- {
- points = points + 10;
- pointorange++;
- }
- else if (color == "yellow")
- {
- points = points + 15;
- pointyellow++;
- }
- else if (color == "white")
- {
- points = points + 20;
- pointwhite++;
- }
- else if (color == "black")
- {
- points = points/2;
- pointblack++;
- }
- else
- {
- Console.WriteLine();
- othercolors++;
- }
- }
- Console.WriteLine($"Total points: {points}");
- Console.WriteLine($"Points from red balls: {pointred}");
- Console.WriteLine($"Points from orange balls: {pointorange}");
- Console.WriteLine($"Points from yellow balls: {pointyellow}");
- Console.WriteLine($"Points from white balls: {pointwhite}");
- Console.WriteLine($"Other colors picked: {othercolors}");
- Console.WriteLine($"Divides from black balls: {pointblack}");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement