Read the isbn into a std::string
variable, then loop through the characters in the string, convert each to a digit, and apply your algorithm.
const isbn_digits = 10;
std::string isbn;
std::cin >> isbn;
assert(isbn.size() == isbn_digits);
int sum = 0;
for (int pos = 0; pos < isbn_digits - 1; ++pos)
sum += (pos + 1) * (isbn[pos] - '0');
if (sum % 11 != isbn[isbn_digits - 1] - '0')
// error