diff options
Diffstat (limited to '')
| -rw-r--r-- | 01_introductory_problems/missing_number_1083.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/01_introductory_problems/missing_number_1083.cpp b/01_introductory_problems/missing_number_1083.cpp new file mode 100644 index 0000000..527abb2 --- /dev/null +++ b/01_introductory_problems/missing_number_1083.cpp | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #include <iostream> | ||
| 2 | |||
| 3 | int main() { | ||
| 4 | long long n, m, sum{0}; | ||
| 5 | std::cin >> n; | ||
| 6 | while (std::cin >> m) | ||
| 7 | sum += m; | ||
| 8 | std::cout << n*(n+1)/2 - sum << std::endl; | ||
| 9 | } | ||
