pat-B-1024. Scientific Counting Act (20)

Source: Internet
Author: User

1024. Scientific counting method (20) time limit of MS memory limit 65536 KB code length limit 8000 B award Program StandardAuthor Hou, qiming

Scientific notation is a convenient way for scientists to represent large or small numbers, satisfying regular expressions [+-][1-9]. " [0-9]+e[+-][0-9]+, that is, the integer portion of the number is only 1 bits, and the fractional part has at least 1 digits, and the sign of the number and its exponential portion is definitely given even for positive numbers.

The real number A is given in the format of the scientific notation, and the program is programmed to output a in normal numeric notation and to ensure that all valid bits are preserved.

Input format:

Each input contains 1 test cases, a real number a in scientific notation. The number is stored for no more than 9999 bytes and the absolute value of its exponent does not exceed 9999.

Output format:

For each test case, output a in a line of normal numeric notation and ensure that all valid bits are retained, including the end of 0.

Input Sample 1:
+1.23400E-03
Output Example 1:
0.00123400
Input Sample 2:
-1.2E+10
Output Example 2:
-12000000000
1#include <bits/stdc++.h>2 using namespacestd;3 4 intMainvoid)5 {6     Charhead,a[10001]= {0};7     intex=0;8scanf"%c%c.%[0-9]e%d", &head,&a[0],a+1, &ex);//Input Split9     if(Head = ='-') printf ("-");Ten     if(ex>=0) One     { A          for(intI=0; i<ex+1|| a[i]!=0; i++) -         { -             if(i==ex+1) printf ("."); theprintf"%c", a[i]==0?'0': A[i]); -         } -     } -     Else +     { -printf"0."); +          for(intI=1; i< (-EX); i++) Aprintf"0"); atprintf"%s", a); -     } -printf"\ n"); -  -     return 0; -}

pat-B-1024. Scientific Counting Act (20)

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.