total = 0 data = ARGV number = ARGV.size for i in 0..number-1 do total += ARGV[i].to_f end puts total/number |
hour = ARGV[0].to_i min = ARGV[1].to_i sec = ARGV[2].to_i printf "Total time is %d seconds \n", sec + 60 * (min + 60 * hour) |
array = ARGV number = ARGV.size-1 for i in 0..number do print array[number-i], " " end print "\n" |
Back |