FEgor04

Untitled

Jun 9th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1.         #include <bits/stdc++.h>
  2.         using namespace std;
  3.         int main() {
  4.             ios_base::sync_with_stdio(0);
  5.             freopen("fraction.in", "r", stdin);
  6.             freopen("fraction.out", "w", stdout);
  7.             string input;
  8.             bool zeroFlag = true;
  9.             cin >> input;
  10.             for(int i = 2; i < input.length() && i <= 9; i++) {
  11.                 if(input[i]=='0' && zeroFlag) {}
  12.                 else {
  13.                 cout << input[i];//<<// "\t" << i;
  14.                 zeroFlag = false;
  15.                 }
  16.                 if(i == 9 && zeroFlag) {
  17.                     cout << 1;
  18.                 }
  19.             }
  20.             cout << "\n" << 1;
  21.             for(int i = 0; i<input.length()-2 && i < 8; i++) {
  22.                 cout << "0";
  23.             }
  24.             return 0;
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment