Advertisement
TheMagnusRex

domashka_4_1

Nov 2nd, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int n,k;
  6.     int sum = 0;
  7.     cout<<"vvedite chislo";
  8.     cin>>n;
  9.     for(k=0;k<n;k++)
  10.     {
  11.         sum=sum+(k*k)
  12.     }
  13.     cout<<sum
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement