Skip to content

Instantly share code, notes, and snippets.

@omas
Created June 27, 2014 02:36
Show Gist options
  • Save omas/f174aa0a5329c2004078 to your computer and use it in GitHub Desktop.
Save omas/f174aa0a5329c2004078 to your computer and use it in GitHub Desktop.
function Calc1(){
output(add(3,2));
output(sub(5,8));
output(mul(3,4));
output(div(7,3));
}
function add(num1,num2){
return [
"加算の結果は"
, num1 + num2
,"です"
].join("");
}
function sub(num1,num2){
return [
"減算の結果は"
, num1 - num2
,"です";
].join("")
}
function mul(num1,num2){
return [
"乗算の結果は"
, num1 * num2
,"です";
].join("")
}
function div(num1,num2){
return [
"除算の結果は"
, num1 / num2
,"です"
].join("");
}
function Calc2(){
output(1 + (2 * 3) - (4 / 2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment