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 HomeWork
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- List<Exercise> exercises = new List<Exercise>();
- while (input != "go go go")
- {
- string[] inputTokens = input.Split(new string[] { " -> ", }, StringSplitOptions.RemoveEmptyEntries);
- string topic = inputTokens[0];
- string courseName = inputTokens[1];
- string judgeContestLink = inputTokens[2];
- List<string> problems = inputTokens[3].Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries).ToList();
- input = Console.ReadLine();
- exercises.Add(new Exercise(topic, courseName, judgeContestLink, problems));
- }
- foreach (var item in exercises)
- {
- Console.WriteLine($"Exercises: {item.Topic}");
- Console.WriteLine($"Problems for exercises and homework for the \"{item.CourseName}\" course @ SoftUni.");
- Console.WriteLine($"Check your solutions here: {item.JudgeContestLink}");
- int listNumber = 1;
- foreach (var exer in item.Problems)
- {
- Console.WriteLine($"{listNumber}. {exer}");
- listNumber++;
- }
- }
- }
- class Exercise
- {
- public string Topic { get; set; }
- public string CourseName { get; set; }
- public string JudgeContestLink { get; set; }
- public List<string> Problems { get; set; }
- public Exercise(string topic, string courseName, string judgeContestLink, List<string> problems)
- {
- Topic = topic;
- CourseName = courseName;
- JudgeContestLink = judgeContestLink;
- Problems = problems;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement