Advertisement
vitormartinotti

Untitled

May 8th, 2024
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. int pecas[1010];
  4.  
  5. int main() {
  6.     int n; scanf("%d", &n);
  7.  
  8.     int aux;
  9.     for(int i = 0; i < n-1; i++){
  10.         scanf("%d", &aux);
  11.         pecas[aux] = 1;
  12.     }
  13.  
  14.     for(int i = 1; i <= n; i++){
  15.         if(pecas[i] == 0){
  16.             printf("%d", i);
  17.             break;
  18.         }
  19.     }
  20.  
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement