A Tour of Go If
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的更多相关文章
- POJ 1637 Sightseeing tour
Sightseeing tour Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9276 Accepted: 3924 ...
- Euler Tour Tree与dynamic connectivity
Euler Tour Tree最大的优点就是可以方便的维护子树信息,这点LCT是做不到的.为什么要维护子树信息呢..?我们可以用来做fully dynamic connectivity(online) ...
- POJ2677 Tour[DP 状态规定]
Tour Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4307 Accepted: 1894 Description ...
- soj 1015 Jill's Tour Paths 解题报告
题目描述: 1015. Jill's Tour Paths Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Every ...
- poj1637 Sightseeing tour
Sightseeing tour Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8859 Accepted: 3728 ...
- 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 ...
- POJ 1637 Sightseeing tour (混合图欧拉路判定)
Sightseeing tour Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6986 Accepted: 2901 ...
- POJ 1637 Sightseeing tour (混合图欧拉回路)
Sightseeing tour Description The city executive board in Lund wants to construct a sightseeing tou ...
- POJ2135 Farm Tour
Farm Tour Time Limit: 2MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u Description ...
- UVa 1347 Tour
Tour Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Description Joh ...
随机推荐
- 增加字体和颜色样式-------CSS
通过使用CSS,控制文本的字体,风格和颜色 1.基本操作: body{ font-family: Verdana, Geneva, Tahoma, sans-serif } body{ font-si ...
- Temporary Post Used For Theme Detection (da655c32-bc15-41ad-bf89-e76c1ec1bea7 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)
This is a temporary post that was not deleted. Please delete this manually. (997facfe-d420-4437-a222 ...
- portlet初学习及HelloWorld例子
1. 在myeclipse中新建一个web project,在src中新建如下类: package com.yoyo.portlet; import java.io.IOException; impo ...
- bzoj 3105: [cqoi2013]新Nim游戏 异或高消 && 拟阵
3105: [cqoi2013]新Nim游戏 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 535 Solved: 317[Submit][Stat ...
- Spring3 +mybatis3 之 MapperScannerConfigurer
之前一直使用"org.mybatis.spring.mapper.MapperFactoryBean"这个类在spring中配置mybatis的dao接口,后来发现如果dao太多话 ...
- UVA 558 Wormholes
要问是否存在一个总权重为负数的环,用dfs即可解决. time:33ms #include <cstdio> #include <cstring> #define N 3000 ...
- *[codility]MaxCounters
http://codility.com/demo/take-sample-test/maxcounters 简单题.注意要记录两个max,一个是最大值,一个是已经生效的最大值. // you can ...
- Altium Designer学习: 允许闭合回路
使用AltiumDesigner画PCB时,顶层和底层都有电源线走 但是通过过孔链接的,主要是因为我这里可使用了几个相同的电源接口,把这些上下层的电源接口连在一起就很容易画出闭合回路,这自身没有太大的 ...
- 二层安全之MAC Flooding解析与解决方法
一.了解MAC Flooding原理 1.1 如图所示,网络中有3个PC和一个交换机,在正常情况下,如果PC A向PC B发送信息,PC C是不会知道的,过程都通过中间的交换机进行透明的处理,并且会记 ...
- bzoj1705
话说这题很久以前就写过,然后好像一直忘了写题解…… 以前看这道题还觉得挺难的,现在觉得好水 首先朴素的想法肯定是动归 f[i,j]表示到处理到第i根电线,最终高度为j的最小花费 f[i,j]:=min ...