using System;namespace ConsoleApplication4 { class Program { static void Main(string[] args) { double A = 100 / 2; double B = Math.Sqrt(A * A - 300 * 4); Console.WriteLine("Width = {0} Height = {1}", (A + B) / 2, (A - B) / 2); } } }
using System; namespace ConsoleApplication4 { class Program { static void Main(string[] args) { double A = 100 / 2; double B = Math.Sqrt(A * A - 300 * 4); Console.WriteLine("Width = {0} Height = {1}", (A + B) / 2, (A - B) / 2); } } } 正解
{
class Program
{
static void Main(string[] args)
{
double A = 100 / 2;
double B = Math.Sqrt(A * A - 300 * 4);
Console.WriteLine("Width = {0} Height = {1}", (A + B) / 2, (A - B) / 2);
}
}
}
{
class Program
{
static void Main(string[] args)
{
double A = 100 / 2;
double B = Math.Sqrt(A * A - 300 * 4);
Console.WriteLine("Width = {0} Height = {1}", (A + B) / 2, (A - B) / 2);
}
}
}
正解
{
class Program
{
static void Main(string[] args)
{
double area = 300, girth = 50, length = 25, temp = 0; while (temp != length)
{
temp = length;
length = area / length;
length = girth - length;
} Console.WriteLine("Width = {0} Height = {1}", length, girth - length);
}
}
}
{
for(int j=1;j<100/2;j++)
{
if((i+j)*2==100)
{
if(i*j==300)
{
Console.WriteLine("Width = {0} Height = {1}", i, j);
}
}
}
}