aboutsummaryrefslogtreecommitdiff
path: root/challenge-145/abigail/tcl/ch-1.tcl
blob: 46a9abcdbab99e5fe25c7549be51fcefdf5dab03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#
# See ../README.md
#

#
# Run as: tclsh ch-1.tcl < input-file
#

set a [split [gets stdin] " "]
set b [split [gets stdin] " "]

set sum 0
for {set i 0} {$i < [llength $a]} {incr i} {
    set sum [expr $sum + [lindex $a $i] * [lindex $b $i]]
}

puts $sum