-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2691d13
commit 1e9764b
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
func main() { | ||
// _Loops1() | ||
// _Loops2() | ||
// _Loops3() | ||
// _Loops4() | ||
_Loops5() | ||
} | ||
|
||
func _Loops1() { | ||
for i := 1; i < 10000+1; i++ { | ||
fmt.Println(i) | ||
} | ||
} | ||
|
||
func _Loops2() { | ||
for i := 65; i < 90+1; i++ { | ||
fmt.Println(i) | ||
for j := 0; j < 3; j++ { | ||
fmt.Printf("\t%#U\n", i) | ||
} | ||
|
||
} | ||
} | ||
|
||
func _Loops3() { | ||
bd := 1991 | ||
for bd <= 2017 { | ||
fmt.Println(bd) | ||
bd++ | ||
} | ||
} | ||
|
||
func _Loops4() { | ||
bd := 1991 | ||
for { | ||
if bd > 2017 { | ||
break | ||
} | ||
fmt.Println(bd) | ||
bd++ | ||
} | ||
} | ||
|
||
func _Loops5() { | ||
for i := 10; i <= 100; i++ { | ||
if i%4 == 0 { | ||
fmt.Printf("%v %v\n", i, i%4) | ||
} | ||
} | ||
} |