Topic Link: B. barnicle
Test instructions: The scientific notation is converted into decimal integers or decimals and output.
Idea: Summer training game met, then thigh a dropped, and said it is a water problem.
Brush CF met again, mercilessly wa a few times. Like what:
0.E0 0
1.0E0 1
Suddenly feel that they can no longer rely on CF this look at the model of sample Dbug.
Attached code:
The scientific notation is converted into decimal integers or decimals and outputs # include <stdio.h> #include <string.h> #include <iostream>using namespace Std;string Str;int Main () {//freopen ("In.cpp", "R", stdin); while (CIN >> str) {string ans = ""; int len = Str.length (); int lose; for (int i=len-1; i>=0;-I.) {if (str[i] = = ' E ') {lose = i; Break }} int a = str[0]-' 0 '; if (a = = 0) {int endd = 0; for (int i=lose-1; i>=0;-i) {if (Str[i] > ' 0 ' && str[i] <= ' 9 ') {End d = i; Break }} str.resize (endd+1); cout << str << Endl; Continue } ans + = str[0]; int b = 0; for (int i=lose+1; i<len; ++i) {b = b*10 + str[i]-' 0 '; } int cnt1 = 0; BOOL first = FALSE; for (int i=2; i<lose; ++i) {if (Cnt1 < b) {ans + = str[i]; } else {if (first = = False) {first = true; Ans + = '. '; } ans + = str[i]; } cnt1++; } while (Cnt1 < b) {ans + = ' 0 '; cnt1++; } if (ans[1] = = '. ') {int anslen = Ans.length (); bool OK = false; for (int i=2; i<anslen; ++i) {if (Ans[i] > ' 0 ' && ans[i] <= ' 9 ') {OK = true; Break }} if (!ok) ans.resize (1); } cout << ans << endl; } return 0;}
Codeforces #362 div2 B. Barnicle