这是我的程序,我收到以下提到的错误:
def main():
print "hello"
if __name__=='__main__':
main()
Run Code Online (Sandbox Code Playgroud)
File "hello.py", line 8
main()
^
IndentationError: expected an indented block
Run Code Online (Sandbox Code Playgroud) 静态构造函数在这里的表现如何?
class a
{
public static int x;
static a()
{
x = b.y + 1;
}
}
class b
{
public static int y = a.x + 1;
static b()
{
}
static void Main(String[] args)
{
Console.WriteLine("x={0} , y={1} ", a.x, b.y);
Console.ReadLine();
}
}
Run Code Online (Sandbox Code Playgroud)
输出::
x = 1,y = 2
怎么样 ?
如何编写一个javascript代码来计算字符串中每个字符的出现次数?
e.g
String is : Hello World
Output :
count of H -> 1
count of e -> 1
count of l -> 3
count of o -> 2
count of r -> 1
count of d -> 1
count of W -> 1
Run Code Online (Sandbox Code Playgroud)