using
System;
using
System.Collections.Generic;
class
GFG {
static
public
void
Main()
{
SortedDictionary<
int
,
string
> My_sdict =
new
SortedDictionary<
int
,
string
>();
My_sdict.Add(004, "Ask.com");
My_sdict.Add(003, "Yahoo");
My_sdict.Add(001, "Google");
My_sdict.Add(005, "AOL.com");
My_sdict.Add(002, "Bing");
Console.WriteLine("Top Search Engines:");
foreach
(KeyValuePair<
int
,
string
> pair
in
My_sdict)
{
Console.WriteLine("Rank: {0} and Name: {1}",
pair.Key, pair.Value);
}
SortedDictionary<
int
,
string
> My_sdict1 =
new
SortedDictionary<
int
,
string
>() {
{1, "Python"},
{5, "Swift"},
{2, "JavaScript"},
{4, "Go" },
{3, "Rust"}};
Console.WriteLine("Top Programming Language
in
2019: ");
foreach
(KeyValuePair<
int
,
string
> pair
in
My_sdict1)
{
Console.WriteLine("Rank:{0} and Name: {1}",
pair.Key, pair.Value);
}
}
}