The if statement looks as it does in C or Java, except that the ( ) are gone and the { } are required.

(Sound familiar?)

package main  

import (
"fmt"
"math"
) func sqrt(x float64) string{
if x < {
return sqrt(-x) + "i"
}
return fmt.Sprint(math.Sqrt(x))
} func main() {
fmt.Println(sqrt(), sqrt(-))
}

A Tour of Go If的更多相关文章

  1. POJ 1637 Sightseeing tour

    Sightseeing tour Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9276   Accepted: 3924 ...

  2. Euler Tour Tree与dynamic connectivity

    Euler Tour Tree最大的优点就是可以方便的维护子树信息,这点LCT是做不到的.为什么要维护子树信息呢..?我们可以用来做fully dynamic connectivity(online) ...

  3. POJ2677 Tour[DP 状态规定]

    Tour Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4307   Accepted: 1894 Description ...

  4. soj 1015 Jill's Tour Paths 解题报告

    题目描述: 1015. Jill's Tour Paths Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Every ...

  5. poj1637 Sightseeing tour

    Sightseeing tour Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8859   Accepted: 3728 ...

  6. A quick tour of JSON libraries in Scala

    A quick tour of JSON libraries in Scala Update (18.11.2015): added spray-json-shapeless libraryUpdat ...

  7. POJ 1637 Sightseeing tour (混合图欧拉路判定)

    Sightseeing tour Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 6986   Accepted: 2901 ...

  8. POJ 1637 Sightseeing tour (混合图欧拉回路)

    Sightseeing tour   Description The city executive board in Lund wants to construct a sightseeing tou ...

  9. POJ2135 Farm Tour

      Farm Tour Time Limit: 2MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u Description ...

  10. UVa 1347 Tour

    Tour Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu Description   Joh ...

随机推荐

  1. chrome extension/plugin path

    C:\Users\Administrator\AppData\Local\Google\Chrome\User Data\Default\Extensions

  2. 微软Hololens学院教程-Hologram 210 Gaze(凝视)【微软教程已经更新,本文是老版本】

    这是老版本的教程,为了不耽误大家的时间,请直接看原文,本文仅供参考哦!原文链接:https://developer.microsoft.com/EN-US/WINDOWS/HOLOGRAPHIC/ho ...

  3. @Transient注解

    以下两个包都包含@Transient注解 java.beans.Transient; javax.persistence.Transient; 使用@Transient时注意区别二者

  4. gentoo

    http://www.aboutyun.com/thread-8522-1-1.html        .java.io.IOException: Connection reset by peer c ...

  5. 换一换js

    (function(){ var tit = $("#changes"), con = $("#wday>ul"), page = con.length, ...

  6. JAVA File常用的API介绍

    package coreJava; import java.io.File; import java.io.IOException; public class FileDemo { public st ...

  7. BZOJ 3996 [TJOI 2015] 线性代数 解题报告

    首先,我们可以得到: $$D = \sum_{i=1}^{n}\sum_{j=1}^{n}a_i\times a_j\times b_{i,j} - \sum_{i=1}^{n}a_i\times c ...

  8. 关于对js的this的几点理解

    四种不同模式小调用的指向 1.函数调用模式的时候,this指向window 2.方法调用模式的时候,this指向方法所在的对象 3.构造函数模式的时候,this指向新生成的实例 4.apply/cal ...

  9. ASP.NET 使用mode=”InProc”方式保存Session老是丢失,无奈改成StateServer 模式。

    http://blog.csdn.net/fox123871/article/details/8165431 session是工作在你的应用程序进程中的.asp.net进程.iis往往会在20分钟之后 ...

  10. IntelliJ IDEA 13怎么创建JAVA SE项目

    如下图,直接下一步,如果需要的话可以选择建立Main函数: