题解 | #牛牛的并联电路#
牛牛的并联电路
https://www.nowcoder.com/practice/6e13936b6fc54f52ac22efd6c8e7fef3
using System;
public class Program {
public static void Main() {
string[] s = Console.ReadLine().Split(" ");
double[] d = 字符串数组转浮点数数组(s);
Console.WriteLine((d[0]*d[1])/(d[0]+d[1]));
}
public static double[] 字符串数组转浮点数数组(string[] arr)
{
double[] d = new double[arr.Length];
for(int i = 0;i < arr.Length;i++)
{
d[i] = double.Parse(arr[i]);
}
return d;
}
}
查看8道真题和解析