Lucian_Adrian

#47 SumaPatrate

Oct 5th, 2021
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin >> n ;
  8. cout << "Rezultatul este " << n*(n+1)*(2*n+1)/6;
  9.  
  10. return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment