Advertisement
ivan4ov4

bobi1

Mar 26th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace ConsoleApp1
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             Console.WriteLine("Enter Students count");
  11.             int students = int.Parse(Console.ReadLine());
  12.             StringBuilder strings = new StringBuilder();
  13.  
  14.             if (students <= 0)
  15.             {
  16.                 Console.WriteLine("Students count is not be empty");
  17.                 return;
  18.             }
  19.  
  20.             for (int i = 1; i < students+1; i++)
  21.             {
  22.                 Console.WriteLine($@"Add student {i} mark ");
  23.                 int mark = int.Parse(Console.ReadLine());
  24.                 strings.AppendLine($@"Student {i} received a mark of {mark}!");
  25.             }
  26.             Console.WriteLine($@"We have {students} students in this class");
  27.             Console.WriteLine(strings);
  28.            
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement