|
|
вернуться в форумSomeone passed this task using C#? I successfuly passed it on Pascal... But i can't do it in C#... 3 Test WA!!!! I used "en-US" format (for example 5.0432). If someone did it please tell what can be wrong.... using System; using System.Text; using System.IO; using System.Threading; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { System.Globalization.CultureInfo local = new System.Globalization.CultureInfo("en-US"); long count = -1; long[] In = new long[1000000]; int ChrSt; string StrIn; string StrSt = ""; while ((ChrSt=Console.In.Read())>0) { if ((ChrSt >= '0') && (ChrSt <= '9')) StrSt += (char)ChrSt; else { if (StrSt != "") { count++; long.TryParse(StrSt, out In[count]); StrSt = ""; } } }
for (long i = count; i > -1; i--) { Console.WriteLine(Math.Sqrt(In[i]).ToString("0.0000",local)); } } } } |
|
|