Created
June 27, 2014 02:36
-
-
Save omas/f174aa0a5329c2004078 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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