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)