Advertisement
Courbe_Impliquee

Cards

Mar 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <clocale>
  4. using namespace std;
  5. int main()
  6. {
  7. setlocale(LC_ALL, "rus");
  8. int n, a, b = 0;
  9. cout << "Введите кол-во карточек" << endl;;
  10. cin >> n;
  11. b = (n*n + n) / 2;
  12. for (int i = 0; i < n - 1; i++) {
  13. cout << "Введите номер карточки : ";
  14. cin >> a;
  15. b -= a;
  16. }
  17. cout << "Номер оставшейся карточки: " << b << endl;
  18. system("pause");
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement