Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using static System.Console;
- namespace ConsoleApp11
- {
- class Program
- {
- static void Main(string[] args)
- {
- Random r = new Random();
- List<int> marks = new List<int>() { };
- const int maxMark = 10;
- byte students = Convert.ToByte(ReadLine());
- bool more10 = false;
- byte more5 = 0;
- bool next = students <= 1 || students >= 30 ? true : false;
- if (!next)
- {
- for (int i = 0; i < students; i++)
- {
- marks.Add(r.Next(1, 10));
- if(marks[i] >= maxMark/2)
- {
- more5++;
- }
- more10 = marks[i] == 10 ? true : false;
- }
- if(!more10)
- {
- Console.WriteLine(more5);
- Console.WriteLine("No");
- } else
- {
- Console.WriteLine(more5);
- Console.WriteLine("Yes");
- }
- }
- ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement