4 Type the following script and put it in a file and execute it in tclsh or wish using the source command.
3. Repeat 2, but this time print the list elements in increasing/decreasing lexicographics order.
4 Type the following script and put it in a file and execute it in tclsh or wish using the source command.
Please study carefully the meaning of each statement.
set arr(Nott) 0115
set arr(Leeds) 0113
set arr(Sheffield) 0114
puts "$arr(Nott)\t $arr(Leeds)\t $arr(Sheffield)\n"
set lis [array get arr]
set len [llength $lis]
for {set i 0} { $i < $len} {incr i} {
set element [lindex $lis $i]
puts stdout "$element \n"
}
Nhận xét
Đăng nhận xét