RosettaCodeData/Task/A+B/Phix/a+b.phix
2019-09-12 10:33:56 -07:00

9 lines
264 B
Text

-- demo\rosetta\AplusB.exw
string s = prompt_string("Enter two numbers separated by a space : ")
sequence r = scanf(s,"%d %d")
if length(r)=1 then
integer {a,b} = r[1], c = a+b
printf(1,"%d + %d = %d\n",{a,b,c})
else
printf(1,"invalid input\n")
end if