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.
usingSystem.CodeDom.Compiler;usingSystem.Collections.Generic;usingSystem.Collections;usingSystem.ComponentModel;usingSystem.Diagnostics.CodeAnalysis;usingSystem.Globalization;usingSystem.IO;usingSystem.Linq;usingSystem.Reflection;usingSystem.Runtime.Serialization;usingSystem.Text.RegularExpressions;usingSystem.Text;usingSystem;classSolution{publicstaticvoidMain(string[]args){try{List<string>numsInInput=newList<string>();stringS=Console.ReadLine();intnum=Int32.Parse(S);// try to convert the string to intfor(inti=0;i<S.Length;i++){numsInInput.Add(S.Substring(i,1));}if(numsInInput.Count()>0){foreach(stringsinnumsInInput){Console.Write(s);}}}catch(Exceptionex){Console.WriteLine("Bad String");}finally{//}//FindTheNumbersInInput(S, ref numsInInput);/*if (numsInInput.Count() > 0) { foreach (string s in numsInInput) { Console.Write(s); } }*/}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 16: Exceptions - String to Integer
You are viewing a single comment's thread. Return to all comments →
Where is the d*mn error here: