package mainimport"fmt"funcmain(){num :=99if num <=50{fmt.Println(num,"is less than or equal to 50")}elseif num >=51&& num <=100{fmt.Println(num,"is between 51 and 100")}else{fmt.Println(num,"is greater than 100")}}
6.For循环
for i :=1; i <=10; i++{if i%2==0{break//loop is terminated if i > 5//continue}fmt.Printf("%d ", i)}
fmt.Printf("\nline after for loop")/// 打印出一下内容/// */// **/// ***/// ****/// *****n :=5for i :=0; i < n; i++{for j :=0; j <= i; j++{fmt.Print("*")}fmt.Println()}/// 打印以下内容/// i = 0 , j = 1/// i = 0 , j = 2/// i = 0 , j = 3/// i = 1 , j = 1/// i = 1 , j = 2/// i = 1 , j = 3/// i = 2 , j = 1/// i = 2 , j = 2/// i = 2 , j = 3for i :=0; i <3; i++{for j :=1; j <4; j++{fmt.Printf("i = %d , j = %d\n", i, j)}}
1. 错误内容: Failed to build pc-util ERROR: Could not build wheels for pc-util, which is required to install pyproject.toml-based projects NativeCommandExitException: Program “pip.exe” ended with non-zero exit code: 2.问题分析: pip出…
一、链接
837. 连通块中点的数量
二、题目
给定一个包含 nn 个点(编号为 1∼n1∼n)的无向图,初始时图中没有边。
现在要进行 mm 个操作,操作共有三种:
C a b,在点 aa 和点 bb 之间连一条边,…