code[vs]-reserved two decimal places-floating-point processing-ladder Bronze

Source: Internet
Author: User

Title Description Description

Leave two decimal places to output a floating-point number.

Enter a description Input Description

A floating-point number. Double in range

Output description Output Description

Two-bit fractional output reserved

Sample input Sample Input

11

Sample output Sample Output

11.00

Data range and Tips Data Size & Hint
C + + with printf ("%.2lf", a);
Pascal with Writeln (A:0:2);
For both C + + and Pascal users, use the double type and do not use the float,real,extended type.

Not much to say directly on the code, the code is as follows:
1#include <stdio.h>2 intMain ()3 {4     DoubleA;5scanf"%LF",&a);6printf"%.2LF", a);7     return 0;8}

code[vs]-reserved two decimal places-floating-point processing-ladder Bronze

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.