Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(0);
- freopen("fraction.in", "r", stdin);
- freopen("fraction.out", "w", stdout);
- string input;
- bool zeroFlag = true;
- cin >> input;
- for(int i = 2; i < input.length() && i <= 9; i++) {
- if(input[i]=='0' && zeroFlag) {}
- else {
- cout << input[i];//<<// "\t" << i;
- zeroFlag = false;
- }
- if(i == 9 && zeroFlag) {
- cout << 1;
- }
- }
- cout << "\n" << 1;
- for(int i = 0; i<input.length()-2 && i < 8; i++) {
- cout << "0";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment