Advertisement
Guest User

Untitled

a guest
Dec 18th, 2011
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.  
  7. long long int n;
  8. while(cin>>n)
  9. {
  10. cout << n*(n+1)/2 << ' ' << n*(n+1)*(n+2)/6 << endl;
  11. }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement