Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Multiplication-tables/Swift/multiplication-tables.swift
Normal file
20
Task/Multiplication-tables/Swift/multiplication-tables.swift
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import Foundation
|
||||
|
||||
let size = 12
|
||||
|
||||
func printRow(with:Int, upto:Int) {
|
||||
|
||||
print(String(repeating: " ", count: (with-1)*4), terminator: "")
|
||||
|
||||
for i in with...upto {
|
||||
print(String(format: "%l4d", i*with), terminator: "")
|
||||
}
|
||||
print()
|
||||
}
|
||||
|
||||
print(" ", terminator: ""); printRow( with: 1, upto: size)
|
||||
print( String(repeating: "–", count: (size+1)*4 ))
|
||||
for i in 1...size {
|
||||
print(String(format: "%l4d",i), terminator:"")
|
||||
printRow( with: i, upto: size)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue