FEgor04

Fraction v2

May 29th, 2019
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 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.     cin >> input;
  9.     if(input == "0" || input == "1") {
  10.         cout << input << "\n" << 1;
  11.         return 0;
  12.     }
  13.     for(int i = 2; i < input.length() && i < 9; i++) {
  14.         cout << input[i];
  15.     }
  16.     cout << "\n" << 1;
  17.     for(int i = 0; i<input.length()-2 && i < 8; i++) {
  18.         cout << "0";
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment