File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 2121
2222 // Complete implementation of a command line tool
2323 @main struct Describe: ParsableCommand {
24- @Argument(help: "The values to describe.")
25- var values: [Double] = []
26-
27- mutating func run() {
28- values.sort()
29- let total = values.reduce(0, +)
24+ @Argument(help: "The values to describe.")
25+ var values: [Double] = []
3026
31- print("""
32- Smallest: \(values.first, default: "No value")
33- Total: \(total)
34- Mean: \(total / Double(values.count))
35- """)
36- }
27+ mutating func run() {
28+ values.sort()
29+ let total = values.reduce(0, +)
30+
31+ print(
32+ """
33+ Smallest: \(values.first, default: "No value")
34+ Total: \(total)
35+ Mean: \(total / Double(values.count))
36+ """)
37+ }
3738 }
3839
3940 - title : Safe
You can’t perform that action at this time.
0 commit comments