Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <clocale>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- int n, a, b = 0;
- cout << "Введите кол-во карточек" << endl;;
- cin >> n;
- b = (n*n + n) / 2;
- for (int i = 0; i < n - 1; i++) {
- cout << "Введите номер карточки : ";
- cin >> a;
- b -= a;
- }
- cout << "Номер оставшейся карточки: " << b << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement