Example of simple input calculation function based on Java scanner object
This article describes the simple input calculation function of Java based on scanner object. Share with you for your reference, as follows:
Problem and code:
Operation results:
Summary of knowledge points:
Create a scanner object for input. And nextint() nextdouble() to read in different types.
experience:
Java input is troublesome. Read the scanner package first, and then create the object. Also note the spaces in println output.
PS: Here we recommend several calculation tools for your further reference:
Online univariate function (equation) solving calculation tool: http://tools.jb51.net/jisuanqi/equ_jisuanqi
Scientific calculator Online_ Advanced calculator online computing: http://tools.jb51.net/jisuanqi/jsqkexue
Online calculator_ Standard calculator: http://tools.jb51.net/jisuanqi/jsq
For more information about Java algorithms, readers who are interested can see the topics on this site: Java data structure and algorithm tutorial, summary of Java DOM node operation skills, summary of java file and directory operation skills, and summary of Java cache operation skills