Advertisement
Josif_tepe

Untitled

Jan 21st, 2023
870
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5. int main()
  6.  
  7. {
  8.     FILE * in = fopen("podatoci.txt", "r");
  9.    
  10.     int barana_cena;
  11.     scanf("%d", &barana_cena);
  12.    
  13.     char niza[1000];
  14.     int cena, godina;
  15.    
  16.     while(fscanf(in, "%s%d%d", niza, &godina, &cena) != EOF) {
  17.         if(cena >= barana_cena) {
  18.             printf("%s %d %d\n", niza, godina, cena);
  19.         }
  20.     }
  21.    
  22.  
  23.    
  24.     return 0;
  25.  
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement