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 ExamResultV2
- {
- class ExamResultV2
- {
- static void Main()
- {
- Dictionary<string, List<double>> resultFromExam = new Dictionary<string, List<double>>();
- resultFromExam["Jackson"] = new List<double>() { 5.2555, 3.25, 5.50 };
- resultFromExam["Krstina"] = new List<double>() { 7.5, 6.7, 8,0 };
- foreach(var r in resultFromExam)
- {
- var personName = r.Key;
- List<string> result = new List<string>();
- var marks = r.Value;
- foreach(var mark in marks)
- {
- result.Add(string.Format("{0:F2}", mark));
- }
- var marksForPrint = string.Join(", ", result);
- Console.WriteLine("{0} - - {1}",personName,marksForPrint);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment