[C++] Tính S(N) = 1^2 + 2^2 + ... + N^2 Ngôn ngữ: C++ Phần mềm: Visual Studio CODE: Select All #include <iostream>using namespace std;float calSum(int N){ float S = 0; for (int i = 1; i <= N; i++) { S += (float)1 / i; } return S;}// Code C++ share by website cnttqn.comvoid main(){ int N; cout << "Input N = "; cin >> N; float result = calSum(N); cout << "Result = " << result << endl; system("pause");}