Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
If statement 使用新行打印执行流程_If Statement_Go_Conditional - Fatal编程技术网

If statement 使用新行打印执行流程

If statement 使用新行打印执行流程,if-statement,go,conditional,If Statement,Go,Conditional,输出: 9 10 27 >= 20 20 我不明白这件事。救救我 Println函数将在一行中输出两个pow函数,然后从Println函数返回后添加\n 27 >= 20 9 20 因为pow函数在函数中之前返回。Println函数将在一行中输出两个pow函数,然后在从Println函数返回后添加\n 27 >= 20 9 20 因为pow函数在函数中之前返回。参数首先求值,而pow内部的Println位于if块中,因此它有条件地运行

输出:

9   
10   
27 >= 20     
20

我不明白这件事。救救我

Println
函数将在一行中输出两个
pow
函数,然后从Println函数返回后添加
\n

27 >= 20    
9 20

因为
pow
函数在函数中之前返回。

Println
函数将在一行中输出两个
pow
函数,然后在从Println函数返回后添加
\n

27 >= 20    
9 20

因为
pow
函数在函数中之前返回。

参数首先求值,而
pow
内部的
Println
位于
if
块中,因此它有条件地运行

27 >= 20    
9 20

首先,计算
main()
Println
的参数。对
pow
的第一次调用导致
9
小于
lim
,因此
pow
本身不打印任何内容并返回
9
。对
pow
的第二次调用导致
27
大于
lim
,因此
pow
打印
27>=20
,并返回
20
。然后,处理参数后,执行main中对
Println
的调用,首先计算printing
920
参数,并且
pow
中的
Println
位于
if
块中,因此它有条件地运行

首先,计算
main()
Println
的参数。对
pow
的第一次调用导致
9
小于
lim
,因此
pow
本身不打印任何内容并返回
9
。对
pow
的第二次调用导致
27
大于
lim
,因此
pow
打印
27>=20
,并返回
20
。然后,在处理参数后,执行main中对
Println
的调用,打印
920

9
10
27 >= 20
20