Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1.  
  2. void procurafaltante(){
  3.  
  4.     string figurinha;
  5.  
  6.     int novo[681];
  7.  
  8.     FILE *arquivo;
  9.  
  10.     int i, a, numFigurinha = 0;
  11.     int rep = 0;
  12.     char desc_lida[50];
  13.  
  14.  
  15.     for(int b = 1; b <= 681; b++){
  16.  
  17.      arquivo = fopen("repetidas.txt","r");
  18.  
  19.  
  20.                         long number = b;
  21.                         char buffer [128];
  22.                         int ret = snprintf(buffer, sizeof(buffer), "%ld", number);
  23.                         char * desc = buffer;
  24.  
  25.                 novo[b] = rep;
  26.     a = 0;
  27.     while(!feof(arquivo)){
  28.  
  29.         setbuf(stdin,NULL);
  30.  
  31.         fscanf(arquivo,"%s",&desc_lida);
  32.  
  33.  
  34.                 if(strcmp(desc_lida,desc)==0){
  35.  
  36.                 novo[b] = a+1;
  37.  
  38.               }
  39.  
  40.  
  41.         }
  42.  
  43.       fclose(arquivo);
  44.  
  45.  
  46.  
  47.     }
  48.  
  49.      cout << novo[50] << endl;
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement