这是我的程序,类使用它被称为Time2我将引用添加到TimeTest我一直得到错误'Time2'是'命名空间'但是像'类型'一样使用
有人可以告诉我这个错误是什么以及如何解决它?
namespace TimeTest
{
class TimeTest
{
static void Main(string[] args)
{
Time2 t1 = new Time2();
}
}
}
Run Code Online (Sandbox Code Playgroud) 我在我的基类中有一个方法返回一个bool,我想要那个bool来确定在我的派生类中相同的重写方法会发生什么.
基础:
public bool Debt(double bal)
{
double deb = 0;
bool worked;
if (deb > bal)
{
Console.WriteLine("Debit amount exceeds the account balance – withdraw cancelled");
worked = false;
}
else
bal = bal - deb;
worked = true;
return worked;
}
Run Code Online (Sandbox Code Playgroud)
派生
public override void Debt(double bal)
{
// if worked is true do something
}
Run Code Online (Sandbox Code Playgroud)
请注意,bal来自我之前制作的构造函数
int c;
int f = 20;
c = 5 / 9 * (f - 32);
Console.WriteLine(c);
Console.ReadLine();
Run Code Online (Sandbox Code Playgroud)
如果我运行此代码c最终为0,这是错误的.谁能告诉我为什么?
我有以下代码和输出
for ($i=0;$i<=100;$i++)
if ($i % 2!=0)
echo $i + "";
?>
Run Code Online (Sandbox Code Playgroud)
13579111315171921232527293133353739414345474951535557596163656769717375777981838587899193959799问题是数字之间没有空格.如何添加此空间