Advertisement
k0mZ

Untitled

Jun 1st, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. #include "stdio.h"
  2. void main(){
  3. int b=1,d=0,r=1;
  4. FILE *f;
  5. f = fopen("binarne-cifre.txt","r");
  6. while(!feof(f)){
  7. fscanf(f,"%d",&b);
  8. d+=b*r;
  9. r*=2;
  10. }
  11. printf("%d",d);
  12. fclose(f);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement