r =教室how do i write code for this formula in c#.f2/f1xrf1 = class or subjectf2 = total credit hour per weekr = classroom推荐答案您可能希望从用户输入值并生成结果。 不幸的是,我们无法看到你的屏幕,所以我们不知道你在做什么环境。但是......假设你知道如何得到三个名为的字符串stringF1 , stringF2 , stringR 那么你所要做的就是将它们转换为数字并完成它:The chances are that you want to input the values from the user and generate the result.Unfortunately, we can't see your screen, so we don;t know what environment you are working in. But...assuming you know haw to get three strings called stringF1, stringF2, and stringR then all you have to do is convert them to numbers and complete it:double f1;if (!TryParse(stringF1, out f1)) { // Report a problem to your user and stop }double f2;if (!TryParse(stringF2, out f2)) { // Report a problem to your user and stop }double r;if (!TryParse(stringR, out r)) { // Report a problem to your user and stop }double result = (f1 / f2) * r;string stringResult = result.ToString();您可以将其打印到控制台,或者放入标签,或者其他任何内容你的envirtonment允许。Which you can print to your console, or put to a lable, or whatever your envirtonment allows. 这篇关于如何为此公式编写代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-29 06:17