Advertisement
Kiporralixo

Nilzon insolente

May 12th, 2017
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <locale.h>
  4.  
  5. int main(void){
  6.    
  7.     setlocale(LC_ALL, "Portuguese");
  8.    
  9.     setbuf(stdout, 0);
  10.     int numero[1000];
  11.     bool verificador;
  12.    
  13.     for(int i = 0; i< 1000; i++){
  14.         printf("Informe o %dº número: \n", i + 1);
  15.         scanf("%d", &numero[i]);  
  16.         printf("________________________________\n");
  17.         if(i == 0){
  18.            
  19.         }else{
  20.             for(int j = 0; j < i ; j++){
  21.                  if(numero[j] == numero[i]){
  22.                      verificador = true;
  23.                      j = i;
  24.                  }else{
  25.                      verificador = false;
  26.                  }
  27.                  if(verificador == true){
  28.                     printf("Repetido\n");
  29.                  }
  30.             }
  31.            
  32.         }
  33.         if(verificador == false){
  34.             printf("digitou => %d\n", numero[i]);
  35.         }
  36.        printf("________________________________\n");
  37.     }  
  38.     system("pause");
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement