Go 关系运算符
2024-09-06 04:20:21
Go 关系运算符
package main
import "fmt"
func main() {
var a int = 21
var b int = 10
if( a == b ) {
fmt.Printf("Line 1 - a is equal to b\n" )
} else {
fmt.Printf("Line 1 - a is not equal to b\n" )
}
if ( a < b ) {
fmt.Printf("Line 2 - a is less than b\n" )
} else {
fmt.Printf("Line 2 - a is not less than b\n" )
}
if ( a > b ) {
fmt.Printf("Line 3 - a is greater than b\n" )
} else {
fmt.Printf("Line 3 - a is not greater than b\n" )
}
/* Lets change value of a and b */
a = 5
b = 20
if ( a <= b ) {
fmt.Printf("Line 4 - a is either less than or equal to b\n" )
}
if ( b >= a ) {
fmt.Printf("Line 5 - b is either greater than or equal to b\n" )
}
}
本文转自:http://codingdict.com/article/23569
最新文章
- R for循环之break,next
- [Asp.net MVC]Asp.net MVC5系列——从控制器访问模型中的数据
- Python MySQL ORM QuickORM hacking
- Android模仿QQ空间图片上传——原理
- 深度神经网络如何看待你,论自拍What a Deep Neural Network thinks about your #selfie
- 关于ecshop中jquery与js冲突解决的方案
- 【Mysql 调用存储过程,输出参数的坑】
- unicode编码相互转换加密解密
- SQL——找出某一字段中内容相同的数据
- vscode1.30.1使用的electron3.0.10中的bug
- 斐讯K2 22.5.9固件刷华硕固件实测教程
- 汇编实验1(又是作业emm)
- 操作循环的关键字switch,break,return的应用及区别
- 修改centos 7 系统时间
- [LeetCode&;Python] Problem 697. Degree of an Array
- springboot logback
- 全网最详细的用pip安装****模块报错:Could not find a version that satisfies the requirement ****(from version:) No matching distribution found for ****的解决办法(图文详解)
- 【bzoj3224】 Tyvj1728—普通平衡树
- 【Ubuntu】VirtualBox 您没有查看“sf_VirtualDisk”的内容所需的权限。
- 【转】ECharts3.x中的点击事件与行为
热门文章
- 使用truelicense实现用于JAVA工程license机制(包括license生成和验证)
- element-ui中table渲染的快速用法
- k8s-1.16 二进制安装
- redis怎么实现FIFO队列思想
- linux POSIX信号量
- 模拟+细节题——cf1236D
- RVIZ可视化平台
- 在使用element-ui搭建的表格中,实现点击";定位";按钮后,屏幕滚动到对应行的位置
- vue 和 react 常用包(插件、组件 或 工具)
- LYOI2018 Hzy&#39;s Planets