Qizjin, qizjin

Source: Internet
Author: User

Qizjin, qizjin
Qi Jin's explanation

Code

1 public class IsopsephyNumber 2 {3 private double value = 0.0; 4 private bool isFlag = false; 5 /// <summary> 6 // odd couple do not enter 7 /// </summary> 8 public void jinuminandounout () 9 {10 while (true) 11 {12 string numberStr = Console. readLine (); 13 if (! String. isNullOrEmpty (numberStr) & numberStr. trim (). toLower (). equals ("exit") 14 {15 break; 16} 17 JudgeNumber (numberStr, out value, out isFlag); 18 if (isFlag) 19 {20 double result = Math. round (value, 3, MidpointRounding. toEven); 21 Console. writeLine ("result:" + result + ":" + value); 22} 23} 24} 25 26 private static void JudgeNumber (string numberStr, out double value, out bool isFlag) 27 {28 value = 0.0; 29 isFlag = double. tryParse (numberStr, out value); 30} 31}
View Code Effect

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.