Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Multiplication-tables/Go/multiplication-tables.go
Normal file
27
Task/Multiplication-tables/Go/multiplication-tables.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Print(" x |")
|
||||
for i := 1; i <= 12; i++ {
|
||||
fmt.Printf("%4d", i)
|
||||
}
|
||||
fmt.Print("\n---+")
|
||||
for i := 1; i <= 12; i++ {
|
||||
fmt.Print("----")
|
||||
}
|
||||
for j := 1; j <= 12; j++ {
|
||||
fmt.Printf("\n%2d |", j)
|
||||
for i := 1; i <= 12; i++ {
|
||||
if i >= j {
|
||||
fmt.Printf("%4d", i*j)
|
||||
} else {
|
||||
fmt.Print(" ")
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue