110,539
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Text;
using System.Text.RegularExpressions;
namespace UralACM
{
class Program
{
static void Main(String[] args)
{
Problems.ReverseRoot_1001();
}
}
static class Problems
{
public static void ReverseRoot_1001()
{
MatchCollection matchCollection = Regex.Matches(Console.In.ReadToEnd(), @"\d+(\.\d+)?");
for (int i = matchCollection.Count - 1; i >= 0; i--)
{
Console.WriteLine("{0:F4}", Math.Sqrt(Double.Parse(matchCollection[i].Value)));
}
}
}
}
using System;
using System.Threading;
using System.Globalization;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
string[] nums = Regex.Split(Console.In.ReadToEnd().Trim(), @"\s+");
for (int i = nums.Length - 1; i >= 0; i--)
Console.WriteLine("{0:F4}", Sqrt(ulong.Parse(nums[i])));
}
static decimal Sqrt(ulong x)
{
decimal r1 = (decimal)Math.Sqrt((double)x);
r1 = decimal.Round(r1, 4);
decimal r2 = r1 * r1;
if (r2 == x) return r1;
decimal r3 = r1 + (r2 < x ? 0.0001M : -0.0001M);
decimal r4 = r3 * r3;
return Math.Abs(r2 - x) <= Math.Abs(r4 - x) ? r1 : r3;
}
}
using System;
using System.Threading;
using System.Globalization;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
string[] nums = Regex.Split(Console.In.ReadToEnd().Trim(), @"\s+");
for (int i = nums.Length - 1; i >= 0; i--)
Console.WriteLine("{0:F4}", Math.Sqrt(ulong.Parse(nums[i])));
}
}
using System;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
string[] nums = Regex.Split(Console.In.ReadToEnd().Trim(), @"\s+");
for (int i = nums.Length - 1; i >= 0; --i)
try { Console.WriteLine("{0:F4}", Math.Sqrt(ulong.Parse(nums[i]))); }
catch (Exception) {}
}
}
using System;
using System.Collections.Generic;
class Test
{
static void Main()
{
int c;
List<ulong> a = new List<ulong>();
while ((c = Console.In.Read()) != -1)
{
if (c >= '0' && c <= '9')
{
ulong n = 0;
do
{
n = n * 10UL + (ulong)(c - '0');
} while ((c = Console.In.Read()) != -1 && c >= '0' && c <= '9');
a.Add(n);
if (c == -1) break;
}
}
for (int i = a.Count - 1; i >= 0; i--)
{
Console.WriteLine("{0:F4}", Sqrt(a[i]));
}
}
static decimal Sqrt(ulong x)
{
decimal r1 = (decimal)Math.Sqrt((double)x);
r1 = decimal.Round(r1, 4, MidpointRounding.AwayFromZero);
if (x < 1E14M) return r1;
decimal r2 = r1 * r1;
if (r2 == x) return r1;
decimal r3 = r1 + (r2 < x ? 0.0001M : -0.0001M);
decimal r4 = r3 * r3;
return Math.Abs(r2 - x) < Math.Abs(r4 - x) ? r1 : r3;
}
}
using System;
using System.IO;
using System.Collections.Generic;
class Test
{
static void Main()
{
int c;
TextReader stdin = Console.In;
List<ulong> a = new List<ulong>();
while ((c = stdin.Read()) != -1)
{
if (c >= '0' && c <= '9')
{
ulong n = 0;
do
{
n = n * 10UL + (ulong)(c - '0');
} while ((c = stdin.Read()) != -1 && c >= '0' && c <= '9');
a.Add(n);
if (c == -1) break;
}
}
for (int i = a.Count - 1; i >= 0; i--)
{
Console.WriteLine("{0:F4}", Sqrt(a[i]));
}
}
static double Sqrt(ulong x)
{
return Math.Sqrt((double)x);
}
}
#include <stdio.h>
#include <math.h>
main()
{
double *a = malloc(300000*sizeof(double));
double temp;
int n = 0;
while (scanf("%lf", &temp) != EOF)
{
*a = sqrt(temp);
a++;
n++;
}
while (n--)
{
a--;
printf("%.4lf\n", *a);
}
}
var a:array[1..1000000] of int64;
i,j:longint;
begin
i:=0;
while not seekeof do begin
inc(i);
read(a[i]);
end;
for j:=i downto 1 do
writeln(sqrt(a[j]):0:4);
end.
var a:array[1..1000000] of int64;
i,j:longint;
begin
{$IFNDEF ONLINE_JUDGE}
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);
{$ENDIF}
i:=0;
while not seekeof do begin
inc(i);
read(a[i]);
end;
for j:=i downto 1 do
writeln(sqrt(a[j]):0:4);
{$IFNDEF ONLINE_JUDGE}
close(input);
close(output);
{$ENDIF}
end.