Algorithm path--POJ brush problem (Java, continuous update)

Source: Internet
Author: User

Let's get some water problems to practiced hand.

1.poj1000

 import   Java.util.Scanner;  /**   * Created by Mxcsky on 2015/1/25.  */ public  class   POJ1000 { static  void   main (string[] args) {Scanne        r in  = new   Scanner (system.in);         int  a = In.nextint ();         int  b = In.nextint ();    System.out.println (a  + b); }}

2.poj1003

ImportJava.util.Scanner;/*** Created by Mxcsky on 2015/1/25.*/ Public classPOJ1003 { Public Static voidMain (string[] args) {Scanner in=NewScanner (system.in);  while(true) {            Doublem =in.nextdouble (); Doublesum = 0.0; inti = 1; if(M < 0.00001) {System.exit (0); }            if(M <= 0.5) {System.out.println ("1 Card (s)"); } Else {                 while(Sum <m) {i++; Sum= SUM + 1.0/i; } System.out.println ((I-1) + "card (s)"); }        }    }}

3.poj1004

ImportJava.util.Scanner;/*** Created by Mxcsky on 2015/1/25.*/ Public classPOJ1004 { Public Static voidMain (string[] args) {Scanner in=NewScanner (system.in); Doublesum = 0.0;  for(inti = 0; I < 12; i++) {sum= Sum +in.nextdouble (); } System.out.printf ("$%.2f", SUM/12); }}

Algorithm path--POJ brush problem (Java, continuous update)

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.