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 CSSZMMA
- {
- class Program
- {
- static void marks()
- {
- Console.WriteLine("Enter marks:");
- int mark1 = int.Parse(Console.ReadLine());
- int mark2 = int.Parse(Console.ReadLine());
- int mark3 = int.Parse(Console.ReadLine());
- int marksTotal = 0;
- if (mark1 > 90)
- marksTotal += 1;
- if (mark2 > 90)
- marksTotal += 1;
- if (mark3 > 90)
- marksTotal += 1;
- Console.WriteLine(marksTotal);
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Amount of students:");
- int stud = int.Parse(Console.ReadLine());
- int allowed = 0;
- for (int i = 1; i <= stud; i++)
- {
- Console.WriteLine("Please specify name:");
- string name = Console.ReadLine();
- marks();
- {
- Console.WriteLine(name);
- allowed += 1;
- }
- }
- Console.WriteLine("Allowed: " + allowed + " students.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement