如何将科学记数法中的数字分配给C#中的变量?
我想使用Plancks Constant,即6.626 X 10 -34
这是我的代码,这是不正确的:
Decimal PlancksConstant = 6.626 * 10e-34;
Run Code Online (Sandbox Code Playgroud) 我很难让这个简单的 if 语句起作用。我正在尝试使用“if”语句将字符串打印一定次数
x = 0
if x < 9:
print "this works"
x = x + 1
else:
print "this doesn't work"
Run Code Online (Sandbox Code Playgroud)
上面代码的结果是它只打印了一次“this works”。我希望将 1 添加到 x 直到 x 达到 9 并且该语句不再正确。
有人能帮我一下吗?
我试图将我的数组的值写入文本文件,但我的输出不合作.
我的代码
using (StreamWriter outputFile = new StreamWriter(@"C:\Users\fakeuser\Desktop\C#\New Text Document.txt"))
{
string[] values = { "Test", "People", "Owls", "Bully"};
foreach (string line in values)
outputFile.WriteLine(values);
Run Code Online (Sandbox Code Playgroud)
这是我得到的输出
我在这里错过了什么?