We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Thank you! I feel like C# isn't very well represented here, and I glad someone put up an example. I didn't realize you could use a while loop with a ReadLine like that. I can tell you one thing though, you can shorten your code a bit by using try and catch instead of flagFound and if-else statements. THANK YOU AGAIN!
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
static void Main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
int numberOfEntries = Convert.ToInt32(Console.ReadLine());
Dictionary phoneBook = new Dictionary();
Day 8: Dictionaries and Maps
You are viewing a single comment's thread. Return to all comments →
Thank you! I feel like C# isn't very well represented here, and I glad someone put up an example. I didn't realize you could use a while loop with a ReadLine like that. I can tell you one thing though, you can shorten your code a bit by using try and catch instead of flagFound and if-else statements. THANK YOU AGAIN!
using System; using System.Collections.Generic; using System.IO; class Solution { static void Main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ int numberOfEntries = Convert.ToInt32(Console.ReadLine()); Dictionary phoneBook = new Dictionary();
}