Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. #include <cmath>
  5. using namespace std;
  6. int main()
  7. {
  8.     int n;
  9.     cin >> n;
  10.     n < 5 ? cout << fixed << setprecision(0) << (pow(10.0f, n) - pow(10.0f, n - 1)) * (pow(10.0f, n - 1) + (pow(10.0f, n) - 1)) / 2 << endl : cout << "4949" << string(n - 4, '9') << "55" << string(n - 2, '0') << endl;
  11.     return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement