Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int getE()
- {
- int n, e = 0;
- cout << "n=";cin >> n;
- for (int x = 1; x <= n; x++)
- e += (3 * x - 2);
- return e;
- }
- int main()
- {
- cout << getE();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement