I'm new to C++ and I can't understand this code. It's really hard. Can someone please explain this to me?
#include <vector>
using namespace std;
int calculate_pairs(vector<int> vec) {
//----WRITE YOUR CODE BELOW THIS LINE----
int result{};
for(size_t i = 0; i < vec.size(); ++i)
for(size_t j = i + 1; j < vec.size(); ++j) /* what is size_t and vec.size? what does this do j = i + 1;*/
result = result + vec.at(i) * vec.at(j); /*what does this do?*/
return result;
}