Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <string>
- #include <cmath>
- long double arithProgSum(long double firstElement, long double lastElement, long double n);
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- 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;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement