当前位置:网站首页>Go language self-study series | if else if statement in golang
Go language self-study series | if else if statement in golang
2022-07-03 15:41:00 【51CTO】
Video source :B standing 《golang Introduction to project practice [2021 newest Go Language course , There is no nonsense , Dry only ! Ongoing update ...]》
Organize the teacher's course content and test notes while studying , And share it with you , Infringement is deleted , Thank you for your support !
Attach summary sticker : Go Language self-study series | Summary _COCOgsta The blog of -CSDN Blog
go Language if Statements can be nested multiple times , Make multiple judgments .
go In language if else if grammar
go In language if else if Syntax examples
Judge the grade according to the score
Running results
It can also be written like this
Running results
Enter the first letter of the day of the week to determine the day of the week , If the first letter is the same , Then continue to judge the second letter
package main
import "fmt"
func f6() {
// Monday Tuesday Wednesday Thursday Friday Saturday Sunday
var c string
fmt.Println(" Enter a character :")
fmt.Scan(&c)
if c == "S" {
fmt.Println(" Enter the second character :")
fmt.Scan(&c)
if c == "a" {
fmt.Println("Saturday")
} else if c == "u" {
fmt.Println("Sunday")
} else {
fmt.Println(" Input error ")
}
} else if c == "F" {
fmt.Println("Friday")
} else if c == "M" {
fmt.Println("Monday")
} else if c == "T" {
fmt.Println(" Enter the second character :")
fmt.Scan(&c)
if c == "u" {
fmt.Println("Tuesday")
} else if c == "h" {
fmt.Println("Thursday")
} else {
fmt.Println(" Input error ")
}
} else if c == "W" {
fmt.Println("Wednesday")
} else {
fmt.Println(" Input error ")
}
}
func main() {
f6()
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
Running results
边栏推荐
- Reflection on some things
- 一些事情的反思
- VC下Unicode和ANSI互转,CStringW和std::string互转
- CString中使用百分号
- How are integer and floating-point types stored in memory
- GCC cannot find the library file after specifying the link library path
- App移动端测试【4】apk的操纵
- Backtracking method to solve batch job scheduling problem
- 分布式事务(Seata) 四大模式详解
- App移动端测试【3】ADB命令
猜你喜欢

How idea starts run dashboard

Reentrantlock usage and source code analysis

详解指针进阶1

几种常见IO模型的原理

Secsha system 1- login function

Find mapping relationship

百度智能云助力石嘴山市升级“互联网+养老服务”智慧康养新模式

Creation and destruction of function stack frames
![App mobile terminal test [5] file writing and reading](/img/f1/4bff6e66b77d0f867bf7237019e982.png)
App mobile terminal test [5] file writing and reading

Introduction series of software reverse cracking (1) - common configurations and function windows of xdbg32/64
随机推荐
Get the executable path through the process PID (queryfullprocessimagename)
Introduction, use and principle of synchronized
String functions that you need to know
Qt常用语句备忘
C language brush questions ~leetcode and simple questions of niuke.com
Tensorflow realizes verification code recognition (III)
几种常见IO模型的原理
Digital image processing -- popular Canny edge detection
Summary of JVM knowledge points
如何使用 @NotNull等注解校验 并全局异常处理
Introduction series of software reverse cracking (1) - common configurations and function windows of xdbg32/64
Popular understanding of ovo and ovr
Kubernetes advanced training camp pod Foundation
WinDbg分析dump文件
Jvm-03-runtime data area PC, stack, local method stack
Creation and destruction of function stack frames
阿特拉斯atlas扭矩枪 USB通讯教程基于MTCOM
视觉上位系统设计开发(halcon-winform)-1.流程节点设计
Driver and application communication
Microservice - declarative interface call openfeign