fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. /* constants */
  4. #define INF (int)1e9
  5. #define EPS 1e-9
  6. /* hardware instructions */
  7. #define bitcount __builtin_popcount
  8. #define gcd __gcd
  9. /* loops, vector, pair */
  10. #define forall(i,a,b) for (int i=a;i<b;i++)
  11. #define foreach(v, c) for (typeof((c).begin())v = (c).begin(); v != (c).end(); v++)
  12. #define all(a) a.begin(), a.end()
  13. #define in(a,b) ( (b).find(a) != (b).end())
  14. #define pb push_back
  15. #define fill(a,v) memset(a, v, sizeof a)
  16. #define sz(a) ((int)(a.size()))
  17. #define mp make_pair
  18. /* common functions */
  19. #define Max(a,b) ( (a) > (b) ? (a) : (b))
  20. #define Min(a,b) ( (a) < (b) ? (a) : (b))
  21. #define checkbit(n,b) ( (n >> b) & 1)
  22. #define DREP(a) sort(all(a)); a.erase(unique(all(a)),a.end())
  23. #define INDEX(arr,ind) (lower_bound(all(arr),ind)-arr.begin())
  24. /* debug */
  25. #define DEBUG
  26. #ifndef DEBUG
  27. #define debug(args...) {dbg, args; cerr<<endl;}
  28. #define dline cout<<"------------"<<endl;
  29. #else
  30. #define debug(args...) // comment
  31. #define dline // comment
  32. #endif
  33. /* other */
  34. #define ll long long
  35. struct debugger {
  36. template<typename T> debugger& operator , (const T& v) {
  37. cerr<<v<<" ";
  38. return *this;
  39. }
  40. } dbg;
  41. int str_to_int(string b) {
  42. int l = b.length();
  43. int s = 0;
  44. forall(i, 0, l) {
  45. s += (b[i]-'0')*pow(10, l-i-1);
  46. }
  47. return s;
  48. }
  49. int main()
  50. {
  51. char a, t, e;
  52. bool p,ifa;
  53. char d1[105], b1[105];
  54. scanf("%c%c", &a, &t);
  55. scanf("%[^e]", d1);
  56. cin>>e>>b1;
  57. string d(d1), b(b1);
  58. int B = str_to_int(b);
  59. p = false;
  60. ifa = false;
  61. int D = d.length();
  62. debug(b, d);
  63. debug(B, D);
  64. if (D != B) {
  65. if (B > D) {
  66. if (a != '0') {
  67. cout<<a;
  68. p = true;
  69. }
  70. } else {
  71. cout<<a;
  72. if ( a != '0')
  73. p = true;
  74. }
  75. forall(i, 0, D) {
  76. if (i == B)
  77. cout<<".";
  78. if (!p && d[i] != '0')
  79. p = true;
  80. if (p)
  81. cout<<d[i];
  82. }
  83. forall(i, D, B)
  84. cout<<0;
  85. } else {
  86. if (a != '0') {
  87. cout<<a;
  88. p = true;
  89. }
  90. forall(i, 0, D) {
  91. if (!p && d[i] != '0') {
  92. p = true;
  93. }
  94. if (p)
  95. cout<<d[i];
  96. }
  97. }
  98. cout<<endl;
  99. return 0;
  100. }
Success #stdin #stdout 0s 3464KB
stdin
7.0e100
stdout
70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000