#include <iostream>
#include <vector>
const int N = 10;
// Вычисляем сумму элементов от 1 до N, затем вычитаем каждый элемент in[]
// Результат - искомое число
int findMissingNumber(const int (&in)[N-1]) {
long fullsum = 0;
for (int i=0; i<N-1; ++i)
fullsum += i+1-in[i];
return fullsum+N;
}
const int in[] = {1, 6, 5, 3, 10, 4, 7, 9, 2};
int main(int argc, char** argv) {
std::cout << findMissingNumber(in) << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKY29uc3QgaW50IE4gPSAxMDsKCi8vINCS0YvRh9C40YHQu9GP0LXQvCDRgdGD0LzQvNGDINGN0LvQtdC80LXQvdGC0L7QsiDQvtGCIDEg0LTQviBOLCDQt9Cw0YLQtdC8INCy0YvRh9C40YLQsNC10Lwg0LrQsNC20LTRi9C5INGN0LvQtdC80LXQvdGCIGluW10KLy8g0KDQtdC30YPQu9GM0YLQsNGCIC0g0LjRgdC60L7QvNC+0LUg0YfQuNGB0LvQvgppbnQgZmluZE1pc3NpbmdOdW1iZXIoY29uc3QgaW50ICgmaW4pW04tMV0pIHsKICAgIGxvbmcgZnVsbHN1bSA9IDA7CiAgICBmb3IgKGludCBpPTA7IGk8Ti0xOyArK2kpCiAgICAgICAgZnVsbHN1bSArPSBpKzEtaW5baV07CiAgICByZXR1cm4gZnVsbHN1bStOOwp9Cgpjb25zdCBpbnQgaW5bXSA9IHsxLCA2LCA1LCAzLCAxMCwgNCwgNywgOSwgMn07CgppbnQgbWFpbihpbnQgYXJnYywgY2hhcioqIGFyZ3YpIHsKICAgIHN0ZDo6Y291dCA8PCBmaW5kTWlzc2luZ051bWJlcihpbikgPDwgc3RkOjplbmRsOwogICAgcmV0dXJuIDA7Cn0=