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;
- namespace Basket // דניאל קרבל - י'5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] Player = new int[5];
- int[] ScoreType = new int[3];
- int Max1 = -1;
- int end = 0, teamsum = 0;
- int[] Best = new int[5];
- while (end != 1)
- {
- Console.WriteLine("Type the player's number(1-5) or 0 to finish.");
- int PlayerNum = int.Parse(Console.ReadLine());
- if (PlayerNum == 0)
- {
- end = 1;
- }
- else
- {
- Console.WriteLine("Type the score type(0-3)");
- int Score = int.Parse(Console.ReadLine());
- Player[PlayerNum - 1] += Score;
- teamsum+= Score;
- if (Player[PlayerNum - 1] >= Max1)
- {
- Max1=Player[PlayerNum-1];
- }
- ScoreType[Score-1] += 1;
- }
- }
- for (int i = 0; i < Player.Length; ++i)
- {
- if (Player[i] == Max1)
- {
- Best[i] = 1;
- }
- }
- Console.WriteLine("The following player numbers have scored the maximum points which is {0}", Max1);
- for (int i = 0; i < Player.Length; ++i)
- {
- if (Best[i] == 1)
- {
- Console.Write(" {0}", i+1);
- }
- }
- Console.WriteLine();
- Console.WriteLine("The team scored a total of " + teamsum + " points.");
- int Max = -1,CommonShot=-1;
- for (int i = 0; i < ScoreType.Length; ++i)
- {
- if (ScoreType[i] > Max)
- {
- Max = ScoreType[i];
- CommonShot = i;
- }
- }
- Console.WriteLine("The most common shot is a {0} point shot", CommonShot+1);
- int[] None = new int[5];
- Console.WriteLine("The following player numbers haven't scored any points:");
- for (int i = 0; i < Player.Length; ++i)
- {
- if (Player[i] == 0)
- {
- Console.Write(" {0} ", i+1);
- }
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment