-- 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