Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- unsigned long long int n, S=0, p;
- cin >> n;
- for (int i=1; i<=n; ++i)
- {
- p=1;
- for (int j=1; j<=i; ++j)
- p*=i;
- S+=p;
- }
- cout << "Rezultatul este " << S << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment