woody1000

плюсуем квадраты чисел

Feb 2nd, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. namespace HW
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7.  
  8. int num;
  9. int k = 0;
  10. int multply = 0;
  11.  
  12. num = Convert.ToInt32(Console.ReadLine());
  13.  
  14.  
  15.  
  16. for (int i = 0; i <= num; i ++)
  17. {
  18. multply = i * i;
  19. k += multply;
  20. }
  21.  
  22. Console.WriteLine(k);
  23. Console.ReadLine();
  24.  
  25.  
  26. }
  27.  
  28. }
  29. }
Add Comment
Please, Sign In to add comment