Jump to content

A+B: Difference between revisions

308 bytes added ,  14 years ago
SNOBOL4 solution added
(→‎{{header|Tcl}}: Do it with files!)
(SNOBOL4 solution added)
Line 206:
=={{header|Ruby}}==
<lang ruby>puts gets.split(/\s+/).map{|x| x.to_i}.inject{|sum, x| sum + x}</lang>
 
=={{header|SNOBOL4}}==
Simple-minded solution (literally "two somethings separated by space")
<lang snobol> input break(" ") . a " " rem . b
output = a + b
end</lang>
 
"Integer aware" solution:
<lang snobol> nums = "0123456789"
input span(nums) . a break(nums) span(nums) . b
output = a + b
end</lang>
 
 
=={{header|Tcl}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.