Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. problema 1684
  2.  
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7. int n,x,s=0;
  8. cin>>n;
  9. x=1;
  10. while (n!=0){
  11. s=s+(x*x);
  12. cout<<s<<" ";
  13. x++;
  14. n--;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement