Advertisement
Raul_julian

Peça-[OBI]

Jun 17th, 2013
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int main() {
  6.    
  7.     int number, quant, i, certo, j, igual = 0;
  8.  
  9.     scanf("%d", &quant);
  10.    
  11.     int numbers[quant-1];
  12.  
  13.         for(i=0; i<quant-1; i++) {
  14.        
  15.             scanf("%d", &numbers[i]);
  16.         }
  17.    
  18.         for(i=1; i<=quant; i++) {
  19.    
  20.             for(j=0; j<quant-1; j++) {
  21.    
  22.                 if(i == numbers[j]) {
  23.                        
  24.                     igual = 1;
  25.                     break;
  26.                 }
  27.  
  28.                 else {
  29.    
  30.                     certo = i;
  31.                     continue ;  
  32.  
  33.                 }
  34.             }
  35.        
  36.         if(igual == 0)  {
  37.    
  38.             printf("%d", certo);
  39.             break;  
  40.         }
  41.  
  42.         else  { igual = 0; }
  43.             }
  44.  
  45.         return 0;  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement