Advertisement
add1ctus

3 Трета

Dec 28th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <cstdio>
  2. #include <string.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     FILE *r = fopen("proizvodi.txt","r");
  9.     FILE *w = fopen("zapishi.txt","w");
  10.  
  11.     int limit;
  12.     scanf("%d",&limit);
  13.  
  14.     int temp;
  15.     char ime[16];
  16.     int lager;
  17.     int cena;
  18.  
  19.     while(fscanf(r,"%d%s%d%d",&temp,ime,&lager,&cena) != EOF)
  20.         if(cena > limit)
  21.             fprintf(w,"%s\t%d\t%d\n",ime,lager,cena);
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement